Rename env to gems in default.nix

This commit is contained in:
Danila Fedorin 2022-03-27 17:52:41 -07:00
parent e533c204fa
commit 2b8397f319

View File

@ -1,7 +1,7 @@
{ bundlerEnv, ruby, stdenv }:
let
env = bundlerEnv {
gems = bundlerEnv {
inherit ruby;
name = "render-test";
@ -13,14 +13,14 @@ in
stdenv.mkDerivation {
name = "katex-converter";
src = ./convert.rb;
buildInputs = [ env ruby ];
buildInputs = [ gems ruby ];
unpackPhase = "echo 'Skipping unpack phase (nothing to unpack)'";
installPhase = ''
mkdir -p $out/{bin,share/katex-converter}
cp $src $out/share/katex-converter/convert.rb
cat > $out/bin/katex-converter <<EOF
#!/bin/sh -e
exec ${env}/bin/bundle exec ${ruby}/bin/ruby $out/share/katex-converter/convert.rb \$@
exec ${gems}/bin/bundle exec ${ruby}/bin/ruby $out/share/katex-converter/convert.rb \$@
EOF
chmod +x $out/bin/katex-converter
'';