Compare commits

...

2 Commits

Author SHA1 Message Date
5818349d91 [nix] nixosModule: add testRun option 2023-11-01 11:04:16 +01:00
b0723ae708 [actions/shutdown] fix missing default value 2023-10-31 21:01:54 +01:00
2 changed files with 14 additions and 2 deletions

View File

@@ -30,7 +30,10 @@ func (s Shutdown) Execute() {
}
func (s Shutdown) Create(config internal.ActionConfig, c ActionResultChan) (Action, error) {
var result Shutdown
result := Shutdown{
Timeout: "now",
}
err := json.Unmarshal(config.Options, &result)
if err != nil {

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