From cee84f4ea04d0ce3a6dc1f2c34d09a0ae5beed95 Mon Sep 17 00:00:00 2001 From: "Wael M. Nasreddine" Date: Tue, 14 Apr 2020 14:53:31 -0700 Subject: launchd: allow customization of the default launchd prefix --- modules/launchd/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'modules/launchd') diff --git a/modules/launchd/default.nix b/modules/launchd/default.nix index cbcac9c..f82df2a 100644 --- a/modules/launchd/default.nix +++ b/modules/launchd/default.nix @@ -88,7 +88,7 @@ let ${config.script} ''); - serviceConfig.Label = mkDefault "org.nixos.${name}"; + serviceConfig.Label = mkDefault "${cfg.labelPrefix}.${name}"; serviceConfig.ProgramArguments = mkIf (cmd != "") [ "/bin/sh" "-c" "exec ${cmd}" ]; serviceConfig.EnvironmentVariables = mkIf (env != {}) env; }; @@ -97,6 +97,15 @@ in { options = { + launchd.labelPrefix = mkOption { + type = types.str; + default = "org.nixos"; + description = '' + The default prefix of the service label. Individual services can + override this by setting the Label attribute. + ''; + }; + launchd.envVariables = mkOption { type = types.attrsOf (types.either types.str (types.listOf types.str)); default = {}; -- cgit v1.2.3