[Nix-dev] nix + rubygems + sinatra
Pjotr Prins
pjotr.public12 at thebird.nl
Tue Mar 3 08:16:15 CET 2009
On Mon, Mar 02, 2009 at 07:17:59PM -0800, Jim Pick wrote:
> I'd actually like to come up with an automated way of generating nix
> expressions from Ruby gems, if that is possible.
There are several possibilities to package gems for Nix (likewise
eggs for Python and packages for R, Perl etc.).
1- Generating Nix expressions from gem definition - like you have
done really using a wrapper:
- Pro: scope for automated generation of packages
- Pro: seamless integration of interpreter/gem dependencies
- Con: 'gem install package' does not work
- Con: potentially lots of work for every dependency
- Con: problems with non-pure Ruby gems
- Con: maintenance nightmare for thousands of gems (BAD)
2- Installing gems in user land (current 'solution')
- Pro: gems are installed in ~/.gems with user permissions
- Con: no version control (BAD)
- Con: no conflict control (hey, we are Nix, right?!)
3- Have gem work with ruby in Nix profile (current 'solution')
- Pro: works with right installation permissions
- Con: makes Nix Ruby package inconsistent - package installs in
Ruby directory /nix/store/ruby-afd980... (BAD)
4- Change 'gem' package controller to support Nix
- Pro: support 'gem install package' out of the box
- Pro: automatically creates a Nix package for every gem
- Pro: automatically share compiled gems
- Pro: automatically support multiple Rubies (1.8, 1.9)
- Con: we need to hack and maintain the gem code
- Con: this needs to be done for eggs, R, cpan etc.
Personally I think (4) is really the way to go. Not easy, but
supporting existing gems will make Nix user friendly for everyone
using Ruby gems and provide a consistent state. I'll be happy to help
out moving this along.
Pj.
More information about the nix-dev
mailing list