liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit b9999857cbab939481de7bdf95c474963fcd534f
parent ba03ddeb3891975c0a38aa28a73ffa8c5972f671
Author: Daniel Barlow <dan@telent.net>
Date:   Sun,  6 Oct 2024 13:13:04 +0100

longrun: don't add logger if producer-for is already set

Diffstat:
Mpkgs/liminix-tools/services/default.nix | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/pkgs/liminix-tools/services/default.nix b/pkgs/liminix-tools/services/default.nix @@ -53,6 +53,7 @@ let , run , notification-fd ? null , buildInputs ? [] + , producer-for ? null , ... } @ args: let logger = service { @@ -64,11 +65,11 @@ let pipeline-name = "${name}-pipeline"; }; in service (args // { - buildInputs = buildInputs ++ [ logger ]; + buildInputs = buildInputs ++ lib.optional (producer-for == null) logger; serviceType = "longrun"; run = serviceScript run; finish = cleanupScript name; - producer-for = "${name}-log"; + producer-for = if producer-for != null then producer-for else "${name}-log"; }); oneshot = { @@ -92,5 +93,6 @@ let }); target = bundle; in { - inherit target bundle oneshot longrun output; + inherit target bundle oneshot output; + longrun = lib.makeOverridable longrun; }