summary refs log tree commit diff
diff options
context:
space:
mode:
authorJanne Heß <janne@hess.ooo>2023-10-20 14:51:15 +0200
committerJanne Heß <janne@hess.ooo>2023-10-20 15:45:43 +0200
commita1012b216051b50a01bdff4c830a9d53e12bfb2e (patch)
tree639ee654580262fd60c79ec84175825372afc740
parente4712e89ff825e93ac7d02376458fdf2e59bb63a (diff)
downloadnixpkgs-a1012b216051b50a01bdff4c830a9d53e12bfb2e.tar
nixpkgs-a1012b216051b50a01bdff4c830a9d53e12bfb2e.tar.gz
nixpkgs-a1012b216051b50a01bdff4c830a9d53e12bfb2e.tar.bz2
nixpkgs-a1012b216051b50a01bdff4c830a9d53e12bfb2e.tar.lz
nixpkgs-a1012b216051b50a01bdff4c830a9d53e12bfb2e.tar.xz
nixpkgs-a1012b216051b50a01bdff4c830a9d53e12bfb2e.tar.zst
nixpkgs-a1012b216051b50a01bdff4c830a9d53e12bfb2e.zip
nixos/switch-to-configuration: Allow not filtering units
-rw-r--r--nixos/doc/manual/development/what-happens-during-a-system-switch.chapter.md4
-rwxr-xr-xnixos/modules/system/activation/switch-to-configuration.pl4
2 files changed, 7 insertions, 1 deletions
diff --git a/nixos/doc/manual/development/what-happens-during-a-system-switch.chapter.md b/nixos/doc/manual/development/what-happens-during-a-system-switch.chapter.md
index 5d6d67f1aa9..82522b33740 100644
--- a/nixos/doc/manual/development/what-happens-during-a-system-switch.chapter.md
+++ b/nixos/doc/manual/development/what-happens-during-a-system-switch.chapter.md
@@ -44,6 +44,10 @@ of actions is always the same:
 - Inspect what changed during these actions and print units that failed and
   that were newly started
 
+By default, some units are filtered from the outputs to make it less spammy.
+This can be disabled for development or testing by setting the environment variable
+`STC_DISPLAY_ALL_UNITS=1`
+
 Most of these actions are either self-explaining but some of them have to do
 with our units or the activation script. For this reason, these topics are
 explained in the next sections.
diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl
index e05f89bb0fb..b3ff3ac0abf 100755
--- a/nixos/modules/system/activation/switch-to-configuration.pl
+++ b/nixos/modules/system/activation/switch-to-configuration.pl
@@ -599,7 +599,9 @@ while (my ($unit, $state) = each(%{$active_cur})) {
                     $units_to_start{$unit} = 1;
                     record_unit($start_list_file, $unit);
                     # Don't spam the user with target units that always get started.
-                    $units_to_filter{$unit} = 1;
+                    if (($ENV{"STC_DISPLAY_ALL_UNITS"} // "") ne "1") {
+                        $units_to_filter{$unit} = 1;
+                    }
                 }
             }