nixpkgs/nixos/modules/system/activation
Emily 56dea6da87 nixos: switch to switch-to-configuration-ng by default
The Rust `switch-to-configuration-ng` rewrite was carefully written
to be compatible with the original Perl script, has been checked
against NixOS VM tests, and has been available on an opt‐in basis
for testing for the 24.05 release cycle.

The next step towards replacing the Perl script entirely is to
switch it on by default so that we can get real‐world testing from
a much greater number of users. Maintaining two implementations in
parallel is becoming a burden; we are having to adjust the systemd
service activation behaviour slightly to fix a long‐standing bug,
and backporting the changes to the Perl script is an unpleasant
process. We will do it anyway to ensure that the Rust and Perl
implementations keep parity with each other throughout the 24.11
release cycle, but we think the time has come to flip the switch.

Taking this step now will give us two to three months to test this in
the wild before the 24.11 release and gain confidence that there are
no regressions. If any non‐trivial problems arise before the final
release, we will revert to the Perl implementation by default. Doing
this switch ASAP will help to disentangle any problems that might
arise from the Rust implementation from problems that arise from the
systemd service activation changes, or the upcoming switch to using
systemd in stage 1 by default.

The main concern that was raised about replacing the Perl script in the
PR that added `switch-to-configuration-ng` was that it is currently
possible to run NixOS on systems that cannot natively host a Rust
compiler. This does not apply to any platforms that have official
support from NixOS, and as far as I know we do not know of any such
systems with users that are not cross‐compiling anyway.

My understanding is that these systems are already broken by default
anyway, as `systemd.shutdownRamfs.enable` is on by default and uses
`make-initrd-ng`, which is also written in Rust. Switching the default
while keeping the Perl implementation around will give us at least
an entire release cycle to find out if there are any users that will
be affected by this and decide what to do about it if so.

There is currently one known inconsistency between
the Perl and Rust implementations, as documented in
<https://github.com/NixOS/nixpkgs/issues/312297>; the Rust
implementation has more accurate handling of failed systemd units.

We slightly adjust the semantics of `system.switch.enable{,Ng}` to
not conflict with each other, so that `system.switch.enableNg` is
on by default, but turning off `system.switch.enable` still results
in no `switch-to-configuration` implementation being used. This
won’t break the configuration of anyone who already opted in to
`system.switch.enableNg` and is probably how the option should have
worked to begin with.
2024-09-06 08:35:43 +01:00
..
lib nixos/activation-script: Add lib.sh with warn() 2024-07-16 20:42:06 +02:00
activatable-system.nix
activation-script.nix nixos/activation-script: Add lib.sh with warn() 2024-07-16 20:42:06 +02:00
bootspec.cue
bootspec.nix
no-clone.nix
specialisation.nix Revert "Merge pull request #333952 from r-vdp/specialisation-name-regex" 2024-08-13 21:33:15 -04:00
switch-to-configuration.pl nixos/switch-to-configuration: add a note for future modifications 2024-06-21 23:22:57 -07:00
switchable-system.nix nixos: switch to switch-to-configuration-ng by default 2024-09-06 08:35:43 +01:00
test.nix nixos/top-level: Rename system.forbiddenDependenciesRegex to system.forbiddenDependenciesRegexes 2024-05-02 21:08:39 +03:00
top-level.nix nixos/top-level: Rename system.forbiddenDependenciesRegex to system.forbiddenDependenciesRegexes 2024-05-02 21:08:39 +03:00