[nix] nixosModule: add testRun option

This commit is contained in:
2023-11-01 11:03:33 +01:00
parent b0723ae708
commit 5818349d91

View File

@@ -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";
};