Merge pull request #11056 from offlinehacker/nixos/systemd/onfailure

systemd module: Add OnFailure to systemd common unit options
This commit is contained in:
Jaka Hudoklin 2015-11-18 22:30:07 +01:00
commit cbca877b01
2 changed files with 11 additions and 0 deletions

View file

@ -170,6 +170,15 @@ in rec {
'';
};
onFailure = mkOption {
default = [];
type = types.listOf types.str;
description = ''
A list of one or more units that are activated when
this unit enters the "failed" state.
'';
};
};

View file

@ -199,6 +199,8 @@ let
{ X-Restart-Triggers = toString config.restartTriggers; }
// optionalAttrs (config.description != "") {
Description = config.description;
} // optionalAttrs (config.onFailure != []) {
OnFailure = toString config.onFailure;
};
};
};