From 1d9f39bf8769ee5fa454e2f76d253f5bdaa1b136 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sun, 25 Sep 2022 21:06:08 +0100 Subject: [PATCH] support notification-fd file in longrun --- pkgs/liminix-tools/builder.sh | 1 + pkgs/liminix-tools/default.nix | 2 ++ 2 files changed, 3 insertions(+) diff --git a/pkgs/liminix-tools/builder.sh b/pkgs/liminix-tools/builder.sh index fd2f897..f113c91 100644 --- a/pkgs/liminix-tools/builder.sh +++ b/pkgs/liminix-tools/builder.sh @@ -11,6 +11,7 @@ test -n "$contents" && for d in $contents; do touch $out/${name}/contents.d/$d done 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 "$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 diff --git a/pkgs/liminix-tools/default.nix b/pkgs/liminix-tools/default.nix index 366fbb2..732f554 100644 --- a/pkgs/liminix-tools/default.nix +++ b/pkgs/liminix-tools/default.nix @@ -11,6 +11,7 @@ name , run , outputs ? [] + , notification-fd ? null , dependencies ? [] } @ args: stdenvNoCC.mkDerivation { name = "${name}.service"; @@ -19,6 +20,7 @@ dependencies = builtins.map (d: d.name) dependencies; shell = "${busybox}/bin/sh"; inherit run; + notificationFd = notification-fd; builder = ./builder.sh; }; oneshot = {