Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions modules/ruby-env/ruby-env.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,19 @@ let
nativeBuildInputs = [ makeBinaryWrapper ];
dontUnpack = true;

buildPhase = ''
mkdir -p $out/bin
for i in ${ruby}/bin/*; do
makeWrapper "$i" $out/bin/$(basename "$i") \
--set GEM_PATH ${rubyEnv}/${ruby.gemPath} \
--set GEM_HOME ${rubyEnv}/${ruby.gemPath}
done
'';
buildPhase =
let
fallbackPath = "lib/ruby/gems/${lib.versions.majorMinor ruby.version}.0";
gemPath = ruby.gemPath or fallbackPath;
in
''
mkdir -p $out/bin
for i in ${ruby}/bin/*; do
makeWrapper "$i" $out/bin/$(basename "$i") \
--set GEM_PATH ${rubyEnv}/${gemPath} \
--set GEM_HOME ${rubyEnv}/${gemPath}
done
'';

dontInstall = true;
doCheck = true;
Expand Down