tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
bundlerEnv: add wrapper
Nikolay Amiantov
10 years ago
75358ad0
73249501
+18
-6
1 changed file
expand all
collapse all
unified
split
pkgs
development
interpreters
ruby
bundler-env
default.nix
+18
-6
pkgs/development/interpreters/ruby/bundler-env/default.nix
···
65
"${bundler}/${ruby.gemPath}" \
66
${shellEscape (toString envPaths)}
67
'' + lib.optionalString (postBuild != null) postBuild;
68
-
passthru = {
69
inherit ruby bundler meta gems;
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
70
env = let
71
irbrc = builtins.toFile "irbrc" ''
72
if !(ENV["OLD_IRBRC"].nil? || ENV["OLD_IRBRC"].empty?)
···
77
'';
78
in stdenv.mkDerivation {
79
name = "interactive-${name}-environment";
80
-
nativeBuildInputs = [ ruby bundlerEnv ];
81
shellHook = ''
82
-
export BUNDLE_GEMFILE=${confFiles}/Gemfile
83
-
export BUNDLE_PATH=${bundlerEnv}/${ruby.gemPath}
84
-
export GEM_HOME=${bundlerEnv}/${ruby.gemPath}
85
-
export GEM_PATH=${bundlerEnv}/${ruby.gemPath}
86
export OLD_IRBRC="$IRBRC"
87
export IRBRC=${irbrc}
88
'';
···
65
"${bundler}/${ruby.gemPath}" \
66
${shellEscape (toString envPaths)}
67
'' + lib.optionalString (postBuild != null) postBuild;
68
+
passthru = rec {
69
inherit ruby bundler meta gems;
70
+
71
+
wrapper = stdenv.mkDerivation {
72
+
name = "wrapper-${name}";
73
+
nativeBuildInputs = [ makeWrapper ];
74
+
buildCommand = ''
75
+
mkdir -p $out/bin
76
+
for i in ${ruby}/bin/*; do
77
+
makeWrapper "$i" $out/bin/$(basename "$i") \
78
+
--set BUNDLE_GEMFILE ${confFiles}/Gemfile \
79
+
--set BUNDLE_PATH ${bundlerEnv}/${ruby.gemPath} \
80
+
--set GEM_HOME ${bundlerEnv}/${ruby.gemPath} \
81
+
--set GEM_PATH ${bundlerEnv}/${ruby.gemPath}
82
+
done
83
+
'';
84
+
};
85
+
86
env = let
87
irbrc = builtins.toFile "irbrc" ''
88
if !(ENV["OLD_IRBRC"].nil? || ENV["OLD_IRBRC"].empty?)
···
93
'';
94
in stdenv.mkDerivation {
95
name = "interactive-${name}-environment";
96
+
nativeBuildInputs = [ wrapper bundlerEnv ];
97
shellHook = ''
0
0
0
0
98
export OLD_IRBRC="$IRBRC"
99
export IRBRC=${irbrc}
100
'';