mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-22 14:45:27 +00:00
Merge pull request #55496 from olorin/topic/systemd-env-length
Update max line length in systemd units
This commit is contained in:
commit
84e4ccc5c8
|
@ -321,7 +321,9 @@ let
|
||||||
in concatMapStrings (n:
|
in concatMapStrings (n:
|
||||||
let s = optionalString (env."${n}" != null)
|
let s = optionalString (env."${n}" != null)
|
||||||
"Environment=${builtins.toJSON "${n}=${env.${n}}"}\n";
|
"Environment=${builtins.toJSON "${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)}
|
# systemd max line length is now 1MiB
|
||||||
|
# https://github.com/systemd/systemd/commit/e6dde451a51dc5aaa7f4d98d39b8fe735f73d2af
|
||||||
|
in if stringLength s >= 1048576 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
|
||||||
'' else if !def.restartIfChanged then ''
|
'' else if !def.restartIfChanged then ''
|
||||||
|
|
Loading…
Reference in a new issue