summaryrefslogtreecommitdiffstats
path: root/pkgs/development/interpreters/ruby/dev.nix
diff options
context:
space:
mode:
authorzimbatm <zimbatm@zimbatm.com>2016-03-01 20:00:54 +0000
committerzimbatm <zimbatm@zimbatm.com>2016-03-14 22:25:48 +0000
commit19820e9a9633e68b72e27f173d7b367a99577655 (patch)
tree49043c85cf4074ca102f64e003fca6338c765f29 /pkgs/development/interpreters/ruby/dev.nix
parent4637cfa51f141dfc6daa3d7c4b3d9c12c7c40706 (diff)
ruby: add a new .dev output to ruby derivations
The idea is to bundle ruby, bundler and bundix together. I was having issues where bundler was installed with ruby 2.3.0 and I wanted to use ruby 2.0.0. With this change all the developer has to do is install `ruby_2_0_0.dev` either in his environment or in a nix-shell.
Diffstat (limited to 'pkgs/development/interpreters/ruby/dev.nix')
-rw-r--r--pkgs/development/interpreters/ruby/dev.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/pkgs/development/interpreters/ruby/dev.nix b/pkgs/development/interpreters/ruby/dev.nix
new file mode 100644
index 000000000000..7787306eb324
--- /dev/null
+++ b/pkgs/development/interpreters/ruby/dev.nix
@@ -0,0 +1,24 @@
+/* An environment for development that bundles ruby, bundler and bundix
+ together. This avoids version conflicts where each is using a diferent
+ version of each-other.
+*/
+{ buildEnv, ruby, bundler, bundix }:
+let
+ bundler_ = bundler.override {
+ ruby = ruby;
+ };
+ bundix_ = bundix.override {
+ ruby = ruby;
+ bundler = bundler_;
+ };
+in
+buildEnv {
+ name = "${ruby.rubyEngine}-dev-${ruby.version}";
+ paths = [
+ bundix_
+ bundler_
+ ruby
+ ];
+ pathsToLink = [ "/bin" ];
+ ignoreCollisions = true;
+}