@@ -1,5 +1,14 @@
11{ lib, stdenv, callPackage, runCommand, ruby }@defs:
22
3+# Use for simple installation of Ruby tools shipped in a Gem.
4+# Start with a Gemfile that includes `gem <toolgem>`
5+# > nix-shell -p bundler bundix
6+# (shell)> bundle lock
7+# (shell)> bundix
8+# Then use rubyTool in the default.nix:
9+
10+# rubyTool { name = "gemifiedTool"; gemdir = ./.; exes = ["gemified-tool"]; }
11+# The 'exes' parameter ensures that a copy of e.g. rake doesn't polute the system.
312{
413 name
514 # gemdir is the location of the Gemfile{,.lock} and gemset.nix; usually ./.
@@ -25,8 +34,8 @@ let
2534 // { inherit preferLocalBuild allowSubstitutes; }; # pass the defaults
2635in
2736 runCommand name cmdArgs ''
28− mkdir -p $out/bin; cd $out;
29− ${(lib.concatMapStrings (x: "ln -s '${basicEnv}/bin/${x}' '${x}';\n") exes)}
37+ mkdir -p $out/bin;
38+ ${(lib.concatMapStrings (x: "ln -s '${basicEnv}/bin/${x}' $out/bin/${x};\n") exes)}
3039 ${(lib.concatMapStrings (s: "makeWrapper $out/bin/$(basename ${s}) $srcdir/${s} " +
3140 "--set BUNDLE_GEMFILE ${basicEnv.confFiles}/Gemfile "+
3241 "--set BUNDLE_PATH ${basicEnv}/${ruby.gemPath} "+