mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
Allow a unit to declare "triggers" that force a restart
The triggers are just arbitrary strings that are included in the unit under X-Restart-Triggers. The idea is that if they change between reconfigurations, switch-to-configuration will restart the unit because its store path changed. This is mostly useful for services that implicitly depend on generated files in /etc. Thus you can say restartTriggers = [ confFile ]; where ‘confFile’ is the derivation that generated the /etc file in question.
This commit is contained in:
parent
285f587025
commit
b606165bd9
2 changed files with 10 additions and 0 deletions
|
@ -83,6 +83,15 @@ rec {
|
|||
'';
|
||||
};
|
||||
|
||||
restartTriggers = mkOption {
|
||||
default = [];
|
||||
description = ''
|
||||
An arbitrary list of items such as derivations. If any item
|
||||
in the list changes between reconfigurations, the service will
|
||||
be restarted.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue