From 5818349d91a1f7875481b9deb69e81a04f19e498 Mon Sep 17 00:00:00 2001 From: kalipso Date: Wed, 1 Nov 2023 11:03:33 +0100 Subject: [PATCH] [nix] nixosModule: add testRun option --- nixos-modules/gokill.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nixos-modules/gokill.nix b/nixos-modules/gokill.nix index 9209a95..4ed2673 100644 --- a/nixos-modules/gokill.nix +++ b/nixos-modules/gokill.nix @@ -3,6 +3,7 @@ let cfg = config.services.gokill; configFile = pkgs.writeText "config.json" (builtins.toJSON cfg.triggers); gokill-pkg = self.packages.x86_64-linux.gokill; + testRun = if cfg.testRun then "-t" else ""; in { options = with lib; { @@ -15,6 +16,14 @@ in ''; }; + testRun = mkOption { + default = false; + type = types.bool; + description = mdDoc '' + When set to true gokill is performing a test run + ''; + }; + triggers = mkOption { description = "list of triggers"; default = []; @@ -61,7 +70,7 @@ in description = "gokill daemon"; serviceConfig = { Type = "simple"; - ExecStart = "${gokill-pkg}/bin/gokill -c ${configFile}"; + ExecStart = "${gokill-pkg}/bin/gokill -c ${configFile} ${testRun}"; Restart = "on-failure"; };