mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 15:33:13 +00:00
switch-to-configuration: Add new option X-OnlyManualStart
This is to facilitate units that should _only_ be manually started and not activated when a configuration is switched to. More specifically this is to be used by the new Nixops deploy-* targets created in https://github.com/NixOS/nixops/pull/1245 that are triggered by Nixops before/after switch-to-configuration is called.
This commit is contained in:
parent
242742d195
commit
db6c94304f
@ -183,7 +183,7 @@ while (my ($unit, $state) = each %{$activePrev}) {
|
||||
# active after the system has resumed, which probably
|
||||
# should not be the case. Just ignore it.
|
||||
if ($unit ne "suspend.target" && $unit ne "hibernate.target" && $unit ne "hybrid-sleep.target") {
|
||||
unless (boolIsTrue($unitInfo->{'RefuseManualStart'} // "no")) {
|
||||
unless (boolIsTrue($unitInfo->{'RefuseManualStart'} // "no") || boolIsTrue($unitInfo->{'X-OnlyManualStart'} // "no")) {
|
||||
$unitsToStart{$unit} = 1;
|
||||
recordUnit($startListFile, $unit);
|
||||
# Don't spam the user with target units that always get started.
|
||||
@ -222,7 +222,7 @@ while (my ($unit, $state) = each %{$activePrev}) {
|
||||
$unitsToReload{$unit} = 1;
|
||||
recordUnit($reloadListFile, $unit);
|
||||
}
|
||||
elsif (!boolIsTrue($unitInfo->{'X-RestartIfChanged'} // "yes") || boolIsTrue($unitInfo->{'RefuseManualStop'} // "no") ) {
|
||||
elsif (!boolIsTrue($unitInfo->{'X-RestartIfChanged'} // "yes") || boolIsTrue($unitInfo->{'RefuseManualStop'} // "no") || boolIsTrue($unitInfo->{'X-OnlyManualStart'} // "no")) {
|
||||
$unitsToSkip{$unit} = 1;
|
||||
} else {
|
||||
if (!boolIsTrue($unitInfo->{'X-StopIfChanged'} // "yes")) {
|
||||
|
Loading…
Reference in New Issue
Block a user