clean up uevent-watch test using writeFennel and mainFunction

requires less cavorting with globals and stuff
This commit is contained in:
Daniel Barlow
2024-04-20 16:53:43 +01:00
parent 771585546d
commit 450d3820b2
3 changed files with 13 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
{
lua
, nellie
, writeFennelScript
, writeFennel
, runCommand
, anoia
, fennel
@@ -14,7 +14,10 @@ stdenv.mkDerivation {
nativeBuildInputs = [ fennelrepl ];
installPhase = ''
mkdir -p $out/bin
cp -p ${writeFennelScript "uevent-watch" [fennel anoia nellie lua.pkgs.luafilesystem] ./watch.fnl} $out/bin/uevent-watch
cp -p ${writeFennel "uevent-watch" {
packages = [fennel anoia nellie lua.pkgs.luafilesystem];
mainFunction = "run";
} ./watch.fnl} $out/bin/uevent-watch
'';
checkPhase = ''
fennelrepl ./test.fnl