diff --git a/nixos/modules/profiles/perlless.nix b/nixos/modules/profiles/perlless.nix index 010e4f8f2a28..6257589ef9eb 100644 --- a/nixos/modules/profiles/perlless.nix +++ b/nixos/modules/profiles/perlless.nix @@ -6,10 +6,12 @@ { - # Disable switching to a new configuration. This is not a necessary - # limitation of a perlless system but just a current one. In the future, - # perlless switching might be possible. - system.switch.enable = lib.mkDefault false; + # 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; @@ -21,6 +23,7 @@ programs.less.lessopen = lib.mkDefault null; programs.command-not-found.enable = lib.mkDefault false; boot.enableContainers = lib.mkDefault false; + boot.loader.grub.enable = lib.mkDefault false; environment.defaultPackages = lib.mkDefault [ ]; documentation.info.enable = lib.mkDefault false; diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl index cabc1dcc2d65..4beca4f0a42a 100755 --- a/nixos/modules/system/activation/switch-to-configuration.pl +++ b/nixos/modules/system/activation/switch-to-configuration.pl @@ -1,5 +1,10 @@ #! @perl@/bin/perl +# NOTE: This script has an alternative implementation at +# . Any behavioral +# modifications to this script should also be made to that implementation. + + # Issue #166838 uncovered a situation in which a configuration not suitable # for the target architecture caused a cryptic error message instead of # a clean failure. Due to this mismatch, the perl interpreter in the shebang diff --git a/pkgs/by-name/sw/switch-to-configuration-ng/README.md b/pkgs/by-name/sw/switch-to-configuration-ng/README.md new file mode 100644 index 000000000000..7401a037dfcb --- /dev/null +++ b/pkgs/by-name/sw/switch-to-configuration-ng/README.md @@ -0,0 +1,3 @@ +# switch-to-configuration-ng + +This program is a reimplementation of [switch-to-configuration](nixos/modules/system/activation/switch-to-configuration.pl) in Rust. The goal is to be compatible in as many ways as possible to the original implementation, at least as long as the original is still in nixpkgs. Any behavioral modifications to this program should also be implemented in the original, and vice versa.