systemd-lib: add name to X-{Reloads,Restart}-Triggers to easily identify to which service/unit/... they belong
This commit is contained in:
parent
0af23b2c3b
commit
9e5aa81a22
1 changed files with 3 additions and 3 deletions
|
@ -274,7 +274,7 @@ in rec {
|
||||||
});
|
});
|
||||||
in "${out}/bin/${scriptName}";
|
in "${out}/bin/${scriptName}";
|
||||||
|
|
||||||
unitConfig = { config, options, ... }: {
|
unitConfig = { config, name, options, ... }: {
|
||||||
config = {
|
config = {
|
||||||
unitConfig =
|
unitConfig =
|
||||||
optionalAttrs (config.requires != [])
|
optionalAttrs (config.requires != [])
|
||||||
|
@ -294,9 +294,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 = "${pkgs.writeText "X-Restart-Triggers" (toString config.restartTriggers)}"; }
|
{ X-Restart-Triggers = "${pkgs.writeText "X-Restart-Triggers-${name}" (toString config.restartTriggers)}"; }
|
||||||
// optionalAttrs (config ? reloadTriggers && config.reloadTriggers != [])
|
// optionalAttrs (config ? reloadTriggers && config.reloadTriggers != [])
|
||||||
{ X-Reload-Triggers = "${pkgs.writeText "X-Reload-Triggers" (toString config.reloadTriggers)}"; }
|
{ X-Reload-Triggers = "${pkgs.writeText "X-Reload-Triggers-${name}" (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