diff --git a/nixos/doc/manual/release-notes/rl-2411.section.md b/nixos/doc/manual/release-notes/rl-2411.section.md index 1720dfea3525..2450b3d6e43a 100644 --- a/nixos/doc/manual/release-notes/rl-2411.section.md +++ b/nixos/doc/manual/release-notes/rl-2411.section.md @@ -34,6 +34,10 @@ Users that want to keep PulseAudio will want to set `services.pipewire.enable = false;` and `hardware.pulseaudio.enable = true;`. There is currently no plan to fully deprecate and remove PulseAudio, however, PipeWire should generally be preferred for new installs. +- The Rust rewrite of the `switch-to-configuration` program is now used for system activation by default. + If you experience any issues, please report them. + The original Perl script can still be used for now by setting `system.switch.enableNg` to `false`. + ## New Modules {#sec-release-24.11-new-modules} - [TaskChampion Sync-Server](https://github.com/GothenburgBitFactory/taskchampion-sync-server), a [Taskwariror 3](https://taskwarrior.org/docs/upgrade-3/) sync server, replacing Taskwarrior 2's sync server named [`taskserver`](https://github.com/GothenburgBitFactory/taskserver). diff --git a/nixos/modules/system/activation/switchable-system.nix b/nixos/modules/system/activation/switchable-system.nix index d70fefd0920b..883584a32ce2 100644 --- a/nixos/modules/system/activation/switchable-system.nix +++ b/nixos/modules/system/activation/switchable-system.nix @@ -4,14 +4,6 @@ let perlWrapped = pkgs.perl.withPackages (p: with p; [ ConfigIniFiles FileSlurp ]); - description = extra: '' - Whether to include the capability to switch configurations. - - Disabling this makes the system unable to be reconfigured via `nixos-rebuild`. - - ${extra} - ''; - in { @@ -20,7 +12,11 @@ in enable = lib.mkOption { type = lib.types.bool; default = true; - description = description '' + description = '' + Whether to include the capability to switch configurations. + + Disabling this makes the system unable to be reconfigured via `nixos-rebuild`. + This is good for image based appliances where updates are handled outside the image. Reducing features makes the image lighter and slightly more secure. @@ -29,23 +25,17 @@ in enableNg = lib.mkOption { type = lib.types.bool; - default = false; - description = description '' - Whether to use `switch-to-configuration-ng`, an experimental - re-implementation of `switch-to-configuration` with the goal of - replacing the original. + default = config.system.switch.enable; + defaultText = lib.literalExpression "config.system.switch.enable"; + description = '' + Whether to use `switch-to-configuration-ng`, the Rust-based + re-implementation of the original Perl `switch-to-configuration`. ''; }; }; config = lib.mkMerge [ - { - assertions = [{ - assertion = with config.system.switch; enable -> !enableNg; - message = "Only one of system.switch.enable and system.switch.enableNg may be enabled at a time"; - }]; - } - (lib.mkIf config.system.switch.enable { + (lib.mkIf (config.system.switch.enable && !config.system.switch.enableNg) { system.activatableSystemBuilderCommands = '' mkdir $out/bin substitute ${./switch-to-configuration.pl} $out/bin/switch-to-configuration \