forked from mirrors/nixpkgs
nixos/lib: hash triggers after converting them to string in systemd-lib
This change is made for two reasons: 1. If `toString config.restartTriggers` containes `\n`, systemd unit file will be ill-formed. 2. This change can limit length of the trigger, although it doesn't matter in most cases.
This commit is contained in:
parent
12d1034a34
commit
cc41b47c6f
|
@ -289,9 +289,9 @@ in rec {
|
||||||
// optionalAttrs (config.requisite != [])
|
// optionalAttrs (config.requisite != [])
|
||||||
{ Requisite = toString config.requisite; }
|
{ Requisite = toString config.requisite; }
|
||||||
// optionalAttrs (config ? restartTriggers && config.restartTriggers != [])
|
// optionalAttrs (config ? restartTriggers && config.restartTriggers != [])
|
||||||
{ X-Restart-Triggers = toString config.restartTriggers; }
|
{ X-Restart-Triggers = builtins.hashString "sha512" (toString config.restartTriggers); }
|
||||||
// optionalAttrs (config ? reloadTriggers && config.reloadTriggers != [])
|
// optionalAttrs (config ? reloadTriggers && config.reloadTriggers != [])
|
||||||
{ X-Reload-Triggers = toString config.reloadTriggers; }
|
{ X-Reload-Triggers = builtins.hashString "sha512" (toString config.reloadTriggers); }
|
||||||
// optionalAttrs (config.description != "") {
|
// optionalAttrs (config.description != "") {
|
||||||
Description = config.description; }
|
Description = config.description; }
|
||||||
// optionalAttrs (config.documentation != []) {
|
// optionalAttrs (config.documentation != []) {
|
||||||
|
|
Loading…
Reference in a new issue