summaryrefslogtreecommitdiff
path: root/modules/launchd
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2016-12-14 21:03:27 +0100
committerDaiderd Jordan <daiderd@gmail.com>2016-12-14 21:03:27 +0100
commite91ffd0ff39513387a2cd2e23f55c63eb84c0d62 (patch)
tree0d9dfc0d636e4c0717cad6d64e09d996c31ff1bd /modules/launchd
parent205c51af518ba37a003cd6c2b8fc7b3290a3e2bd (diff)
add KeepAlive submodule for launchd.<name>.serviceConfig
Diffstat (limited to 'modules/launchd')
-rw-r--r--modules/launchd/launchd.nix48
1 files changed, 47 insertions, 1 deletions
diff --git a/modules/launchd/launchd.nix b/modules/launchd/launchd.nix
index 8bf7ebb..9dd88cf 100644
--- a/modules/launchd/launchd.nix
+++ b/modules/launchd/launchd.nix
@@ -150,7 +150,53 @@ with lib;
};
KeepAlive = mkOption {
- type = types.nullOr types.bool;
+ type = types.nullOr (types.either types.bool (types.submodule {
+ options = {
+
+ SuccessfulExit = mkOption {
+ type = types.nullOr types.bool;
+ default = null;
+ description = ''
+ If true, the job will be restarted as long as the program exits and with an exit status of zero.
+ If false, the job will be restarted in the inverse condition. This key implies that "RunAtLoad"
+ is set to true, since the job needs to run at least once before we can get an exit status.
+ '';
+ };
+
+ NetworkState = mkOption {
+ type = types.nullOr types.bool;
+ default = null;
+ description = ''
+ If true, the job will be kept alive as long as the network is up, where up is defined as at least
+ one non-loopback interface being up and having IPv4 or IPv6 addresses assigned to them. If
+ false, the job will be kept alive in the inverse condition.
+ '';
+ };
+
+ PathState = mkOption {
+ type = types.nullOr (types.attrsOf types.bool);
+ default = null;
+ description = ''
+ Each key in this dictionary is a file-system path. If the value of the key is true, then the job
+ will be kept alive as long as the path exists. If false, the job will be kept alive in the
+ inverse condition. The intent of this feature is that two or more jobs may create semaphores in
+ the file-system namespace.
+ '';
+ };
+
+ OtherJobEnabled = mkOption {
+ type = types.nullOr (types.attrsOf types.bool);
+ default = null;
+ description = ''
+ Each key in this dictionary is the label of another job. If the value of the key is true, then
+ this job is kept alive as long as that other job is enabled. Otherwise, if the value is false,
+ then this job is kept alive as long as the other job is disabled. This feature should not be
+ considered a substitute for the use of IPC.
+ '';
+ };
+
+ };
+ }));
default = null;
description = ''
This optional key is used to control whether your job is to be kept continuously running or to let