Merge pull request #298983 from illustris/mysql

nixos/systemd-lib: fix restart/reloadTriggers when passing paths

authored by Ryan Hendrickson and committed by GitHub 61153af0 6676e0c0

+16 -2
+3
nixos/doc/manual/release-notes/rl-2405.section.md
··· 351 352 - Ada packages (libraries and tools) have been moved into the `gnatPackages` scope. `gnatPackages` uses the default GNAT compiler, `gnat12Packages` and `gnat13Packages` use the respective matching compiler version. 353 354 - `spark2014` has been renamed to `gnatprove`. A version of `gnatprove` matching different GNAT versions is available from the different `gnatPackages` sets. 355 356 - `services.resolved.fallbackDns` can now be used to disable the upstream fallback servers entirely by setting it to an empty list. To get the previous behaviour of the upstream defaults set it to null, the new default, instead.
··· 351 352 - Ada packages (libraries and tools) have been moved into the `gnatPackages` scope. `gnatPackages` uses the default GNAT compiler, `gnat12Packages` and `gnat13Packages` use the respective matching compiler version. 353 354 + - Paths provided as `restartTriggers` and `reloadTriggers` for systemd units will now be copied into the nix store to make the behavior consistent. 355 + Previously, `restartTriggers = [ ./config.txt ]`, if defined in a flake, would trigger a restart when any part of the flake changed; and if not defined in a flake, would never trigger a restart even if the contents of `config.txt` changed. 356 + 357 - `spark2014` has been renamed to `gnatprove`. A version of `gnatprove` matching different GNAT versions is available from the different `gnatPackages` sets. 358 359 - `services.resolved.fallbackDns` can now be used to disable the upstream fallback servers entirely by setting it to an empty list. To get the previous behaviour of the upstream defaults set it to null, the new default, instead.
+13 -2
nixos/lib/systemd-lib.nix
··· 14 elem 15 filter 16 filterAttrs 17 flip 18 head 19 isInt 20 isList 21 length 22 makeBinPath 23 makeSearchPathOutput ··· 28 optional 29 optionalAttrs 30 optionalString 31 range 32 replaceStrings 33 reverseList ··· 366 // optionalAttrs (config.requisite != []) 367 { Requisite = toString config.requisite; } 368 // optionalAttrs (config ? restartTriggers && config.restartTriggers != []) 369 - { X-Restart-Triggers = "${pkgs.writeText "X-Restart-Triggers-${name}" (toString config.restartTriggers)}"; } 370 // optionalAttrs (config ? reloadTriggers && config.reloadTriggers != []) 371 - { X-Reload-Triggers = "${pkgs.writeText "X-Reload-Triggers-${name}" (toString config.reloadTriggers)}"; } 372 // optionalAttrs (config.description != "") { 373 Description = config.description; } 374 // optionalAttrs (config.documentation != []) {
··· 14 elem 15 filter 16 filterAttrs 17 + flatten 18 flip 19 head 20 isInt 21 isList 22 + isPath 23 length 24 makeBinPath 25 makeSearchPathOutput ··· 30 optional 31 optionalAttrs 32 optionalString 33 + pipe 34 range 35 replaceStrings 36 reverseList ··· 369 // optionalAttrs (config.requisite != []) 370 { Requisite = toString config.requisite; } 371 // optionalAttrs (config ? restartTriggers && config.restartTriggers != []) 372 + { X-Restart-Triggers = "${pkgs.writeText "X-Restart-Triggers-${name}" (pipe config.restartTriggers [ 373 + flatten 374 + (map (x: if isPath x then "${x}" else x)) 375 + toString 376 + ])}"; } 377 // optionalAttrs (config ? reloadTriggers && config.reloadTriggers != []) 378 + { X-Reload-Triggers = "${pkgs.writeText "X-Reload-Triggers-${name}" (pipe config.reloadTriggers [ 379 + flatten 380 + (map (x: if isPath x then "${x}" else x)) 381 + toString 382 + ])}"; } 383 // optionalAttrs (config.description != "") { 384 Description = config.description; } 385 // optionalAttrs (config.documentation != []) {