nixos/systemd: ignore null environment options
This commit is contained in:
parent
ad4ad11fbc
commit
8bb6fdc4f9
@ -348,7 +348,8 @@ let
|
|||||||
[Service]
|
[Service]
|
||||||
${let env = cfg.globalEnvironment // def.environment;
|
${let env = cfg.globalEnvironment // def.environment;
|
||||||
in concatMapStrings (n:
|
in concatMapStrings (n:
|
||||||
let s = "Environment=\"${n}=${env.${n}}\"\n";
|
let s = optionalString (env."${n}" != null)
|
||||||
|
"Environment=\"${n}=${env.${n}}\"\n";
|
||||||
in if stringLength s >= 2048 then throw "The value of the environment variable ‘${n}’ in systemd service ‘${name}.service’ is too long." else s) (attrNames env)}
|
in if stringLength s >= 2048 then throw "The value of the environment variable ‘${n}’ in systemd service ‘${name}.service’ is too long." else s) (attrNames env)}
|
||||||
${if def.reloadIfChanged then ''
|
${if def.reloadIfChanged then ''
|
||||||
X-ReloadIfChanged=true
|
X-ReloadIfChanged=true
|
||||||
|
Loading…
Reference in New Issue
Block a user