summaryrefslogtreecommitdiffstats
path: root/nixos/modules/system
diff options
context:
space:
mode:
authoradisbladis <adisbladis@gmail.com>2020-03-09 11:28:07 +0000
committeradisbladis <adisbladis@gmail.com>2020-03-09 11:28:07 +0000
commitdb6c94304f3186b2e09abfd01f8c485b7886e0c4 (patch)
tree0a0b92d4c2f3bcf22e4fdf55345dede01daadf5c /nixos/modules/system
parent242742d195926bf4fd9fee17f57bb6cfbd56ecab (diff)
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.
Diffstat (limited to 'nixos/modules/system')
-rw-r--r--nixos/modules/system/activation/switch-to-configuration.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl
index 641cf9faadc9..b82d69b3bb85 100644
--- a/nixos/modules/system/activation/switch-to-configuration.pl
+++ b/nixos/modules/system/activation/switch-to-configuration.pl
@@ -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")) {