NixOS 25.11 released!

By default nixos-rebuild switch now symlinks to nixos-rebuild-ng as per the notes although this didn’t seem to be the case in ‘unstable’ for me so this is the first time I am trying it.

  • nixos-rebuild-ng, a full rewrite of nixos-rebuild in Python, is enabled by default from this release. You can disable it by setting to false in your configuration if you need, but please report any issues. It is expected that the next major version of NixOS (26.05) will remove the {option}system.rebuild.enableNg option.
$ ls -lat | grep nixos-rebuild
lrwxrwxrwx 1 root root    84 Jan  1  1970 nixos-rebuild -> /nix/store/vvfclqlzrwsbmk015rwysvqrp7dmir03-nixos-rebuild-ng-25.11/bin/nixos-rebuild

nixos-rebuild-ng seems to require that you have git installed.

$ sudo nixos-rebuild switch
warning: Git not found; cannot figure out revision of '/nix/store/92bnyyz7z28m9ar34c3g9z8l4hagl26y-nixos-25.11.612.d542db745310/nixos'
building the system configuration...

This resolves easily with the following config (although there was no mention that 25.11 would expect/require git).

{ config, pkgs, ... }:

{
	environment = {
		systemPackages = with pkgs; [
			git
		];
	};
}

Using the option system.rebuild.enableNg = false; seems to eliminate the requirement for git but does give the following warning.

evaluation warning: The Bash implementation of nixos-rebuild will be deprecated and removed in the 26.05 release of NixOS.
                    Please migrate to the newer implementation by removing 'system.rebuild.enableNg = false' from your configuration.
                    If you are unable to migrate due to any issues with the new implementation, please create an issue and tag the maintainers of 'nixos-rebuild-ng'.

@k0kada : Any chance you can please give a bit of an answer about what purpose git serves for nixos-rebuild or perhaps how it is used? So far I haven’t seen any network traffic that appears to be related to git being used as part of nixos-rebuild. Many thanks.

Edit: I have just been reading through the home-page for nixos-rebuild-ng which I got from search.nixos.org.

The caveat at the bottom was quite concerning.

Bugs in the profile manipulation can cause corruption of your profile that may be difficult to fix, so right now I only recommend using nixos-rebuild-ng if you are testing in a VM or in a filesystem with snapshots like BTRFS or ZFS. Those bugs are unlikely to be unfixable but the errors can be difficult to understand. If you want to go on, nix-collect-garbage -d and nix store repair are your friends

4 Likes