nixos/systemd: update max line length in systemd units
The length check was introduced[0] to match systemd's max line
length. This limit has been increased[1][2] to 1MiB, starting with
systemd v235.
[0] https://github.com/nixos/nixpkgs/issues/3403
[1] e6dde451a5
(relevant systemd commit)
[2] https://github.com/systemd/systemd/issues/3302
(more context on systemd change)
This commit is contained in:
parent
2aa0ba2c9b
commit
3755577ba6
@ -321,7 +321,9 @@ let
|
||||
in concatMapStrings (n:
|
||||
let s = optionalString (env."${n}" != null)
|
||||
"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 ''
|
||||
X-ReloadIfChanged=true
|
||||
'' else if !def.restartIfChanged then ''
|
||||
|
Loading…
Reference in New Issue
Block a user