support notification-fd file in longrun

This commit is contained in:
Daniel Barlow 2022-09-25 21:06:08 +01:00
parent 92e42f1d45
commit 1d9f39bf87
2 changed files with 3 additions and 0 deletions

View file

@ -11,6 +11,7 @@ test -n "$contents" && for d in $contents; do
touch $out/${name}/contents.d/$d touch $out/${name}/contents.d/$d
done done
test -n "$run" && (echo -e "#!$shell\n$run" > $out/${name}/run) test -n "$run" && (echo -e "#!$shell\n$run" > $out/${name}/run)
test -n "${notificationFd}" && (echo ${notificationFd} > $out/${name}/notification-fd)
test -n "$up" && (echo -e "#!$shell\n$up" > $out/${name}/up) test -n "$up" && (echo -e "#!$shell\n$up" > $out/${name}/up)
test -n "$down" && (echo -e "#!$shell\n$down" > $out/${name}/down) test -n "$down" && (echo -e "#!$shell\n$down" > $out/${name}/down)
for i in $out/${name}/{down,up,run} ; do test -f $i && chmod +x $i; done for i in $out/${name}/{down,up,run} ; do test -f $i && chmod +x $i; done

View file

@ -11,6 +11,7 @@
name name
, run , run
, outputs ? [] , outputs ? []
, notification-fd ? null
, dependencies ? [] , dependencies ? []
} @ args: stdenvNoCC.mkDerivation { } @ args: stdenvNoCC.mkDerivation {
name = "${name}.service"; name = "${name}.service";
@ -19,6 +20,7 @@
dependencies = builtins.map (d: d.name) dependencies; dependencies = builtins.map (d: d.name) dependencies;
shell = "${busybox}/bin/sh"; shell = "${busybox}/bin/sh";
inherit run; inherit run;
notificationFd = notification-fd;
builder = ./builder.sh; builder = ./builder.sh;
}; };
oneshot = { oneshot = {