add uevent-watch, which toggles services based on uevent msgs

This commit is contained in:
Daniel Barlow
2024-04-15 21:15:07 +01:00
parent 5564cf0554
commit ea2b25168e
6 changed files with 297 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
{
lua
, nellie
, writeFennelScript
, runCommand
, anoia
, fennel
, stdenv
, fennelrepl
}:
stdenv.mkDerivation {
name = "uevent-watch";
src = ./.;
nativeBuildInputs = [ fennelrepl ];
installPhase = ''
mkdir -p $out/bin
cp -p ${writeFennelScript "uevent-watch" [fennel anoia nellie lua.pkgs.luafilesystem] ./watch.fnl} $out/bin/uevent-watch
'';
checkPhase = ''
fennelrepl ./test.fnl
'';
doCheck = true;
}