diff --git a/nixos/doc/manual/configuration/profiles/perlless.section.md b/nixos/doc/manual/configuration/profiles/perlless.section.md index bf055971cfc42..9ee70ed3b49c5 100644 --- a/nixos/doc/manual/configuration/profiles/perlless.section.md +++ b/nixos/doc/manual/configuration/profiles/perlless.section.md @@ -1,11 +1,5 @@ # Perlless {#sec-perlless} -::: {.warning} -If you enable this profile, you will NOT be able to switch to a new -configuration and thus you will not be able to rebuild your system with -nixos-rebuild! -::: - Render your system completely perlless (i.e. without the perl interpreter). This includes a mechanism so that your build fails if it contains a Nix store path that references the string "perl". diff --git a/nixos/doc/manual/release-notes/rl-2411.section.md b/nixos/doc/manual/release-notes/rl-2411.section.md index 11d8da6341253..a302d6aab87b6 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/profiles/perlless.nix b/nixos/modules/profiles/perlless.nix index cb98895743d54..c331a90882676 100644 --- a/nixos/modules/profiles/perlless.nix +++ b/nixos/modules/profiles/perlless.nix @@ -2,13 +2,6 @@ { - # switch-to-configuration-ng reimplements switch-to-configuration, but - # without perl. - system.switch = lib.mkDefault { - enable = false; - enableNg = true; - }; - # Remove perl from activation boot.initrd.systemd.enable = lib.mkDefault true; system.etc.overlay.enable = lib.mkDefault true; diff --git a/nixos/modules/system/activation/switchable-system.nix b/nixos/modules/system/activation/switchable-system.nix index d70fefd0920b4..883584a32ce21 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 \ diff --git a/nixos/tests/switch-test.nix b/nixos/tests/switch-test.nix index d90e5bb088cee..462f4247789ec 100644 --- a/nixos/tests/switch-test.nix +++ b/nixos/tests/switch-test.nix @@ -48,10 +48,7 @@ in { nodes = { machine = { pkgs, lib, ... }: { - system.switch = { - enable = !ng; - enableNg = ng; - }; + system.switch.enableNg = ng; environment.systemPackages = [ pkgs.socat ]; # for the socket activation stuff users.mutableUsers = false;