summaryrefslogtreecommitdiff
path: root/modules/launchd
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2017-05-14 00:26:22 +0200
committerDaiderd Jordan <daiderd@gmail.com>2017-05-14 00:34:34 +0200
commit264a9237ddaa451efcd77e5fc2d9f78598447caf (patch)
treed3f27d129acebad18c33a5927d192a9bd5bcc629 /modules/launchd
parenta4eb645d0da4ce4743d86e1cfad7f7deb94de52c (diff)
launchd: add options for setting launchd environment variables
Fixes #12
Diffstat (limited to 'modules/launchd')
-rw-r--r--modules/launchd/default.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/modules/launchd/default.nix b/modules/launchd/default.nix
index 078bfff..3a7bfea 100644
--- a/modules/launchd/default.nix
+++ b/modules/launchd/default.nix
@@ -86,6 +86,34 @@ in
{
options = {
+ launchd.envVariables = mkOption {
+ type = types.attrsOf (types.either types.str (types.listOf types.str));
+ default = {};
+ example = { LANG = "nl_NL.UTF-8"; };
+ description = ''
+ A set of environment variables to be set on all future
+ processes launched by launchd in the caller's context.
+ The value of each variable can be either a string or a list of
+ strings. The latter is concatenated, interspersed with colon
+ characters.
+ '';
+ apply = mapAttrs (n: v: if isList v then concatStringsSep ":" v else v);
+ };
+
+ launchd.user.envVariables = mkOption {
+ type = types.attrsOf (types.either types.str (types.listOf types.str));
+ default = {};
+ example = { LANG = "nl_NL.UTF-8"; };
+ description = ''
+ A set of environment variables to be set on all future
+ processes launched by launchd in the caller's context.
+ The value of each variable can be either a string or a list of
+ strings. The latter is concatenated, interspersed with colon
+ characters.
+ '';
+ apply = mapAttrs (n: v: if isList v then concatStringsSep ":" v else v);
+ };
+
launchd.agents = mkOption {
default = {};
type = types.attrsOf (types.submodule serviceOptions);