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