Rename env to gems in default.nix

master
Danila Fedorin 10 months ago
parent e533c204fa
commit 2b8397f319
  1. 6
      default.nix

@ -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
'';

Loading…
Cancel
Save