2
0
Files
liminix/pkgs/fennelc/default.nix

23 lines
429 B
Nix

{
lua,
runCommand,
}:
let
fennel = lua.pkgs.fennel;
in
runCommand "build-fennelc"
{
nativeBuildInputs = [ fennel ];
}
''
LUAPATH=$(ls -d ${fennel}/share/lua/*)
mkdir -p $out/bin
(
exec > $out/bin/fennelc
echo '#! ${lua}/bin/lua'
echo "package.path = \"''${LUAPATH}/?.lua;''${LLPATH}/?.lua;\" .. package.path"
fennel --compile ${./fennelc.fnl}
)
chmod +x $out/bin/fennelc
''