nixos/switch-to-configuration: Fix ordering and indentation

This makes the order of operations the same in dry-activate and a "true"
activate. Also fixes the indentation I messed up and drop a useless
unlink() call (we are already unlinking that file earlier).

Changed files
+4 -5
nixos
modules
system
+4 -5
nixos/modules/system/activation/switch-to-configuration.pl
···
if scalar @unitsToAlsoStopFiltered;
}
-
print STDERR "NOT restarting the following changed units as well: ", join(", ", sort(keys %unitsToAlsoSkip)), "\n"
-
if scalar(keys %unitsToAlsoSkip) > 0;
+
print STDERR "would NOT restart the following changed units as well: ", join(", ", sort(keys %unitsToAlsoSkip)), "\n"
+
if scalar(keys %unitsToAlsoSkip) > 0;
print STDERR "would restart systemd\n" if $restartSystemd;
+
print STDERR "would reload the following units: ", join(", ", sort(keys %unitsToReload)), "\n"
+
if scalar(keys %unitsToReload) > 0;
print STDERR "would restart the following units: ", join(", ", sort(keys %unitsToRestart)), "\n"
if scalar(keys %unitsToRestart) > 0;
my @unitsToStartFiltered = filterUnits(\%unitsToStart);
print STDERR "would start the following units: ", join(", ", @unitsToStartFiltered), "\n"
if scalar @unitsToStartFiltered;
-
print STDERR "would reload the following units: ", join(", ", sort(keys %unitsToReload)), "\n"
-
if scalar(keys %unitsToReload) > 0;
-
unlink($dryRestartByActivationFile);
exit 0;
}