From 9806c0cd3e6e808d0cc2089020f7f80c97c96cca Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 10 Jun 2025 18:32:23 +0100 Subject: [PATCH 1/3] nixos/tools: enable `system.rebuild.enableNg` by default --- nixos/doc/manual/release-notes/rl-2511.section.md | 2 ++ nixos/modules/installer/tools/tools.nix | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/nixos/doc/manual/release-notes/rl-2511.section.md b/nixos/doc/manual/release-notes/rl-2511.section.md index 932ff7b6d6f7..8b2cfb815780 100644 --- a/nixos/doc/manual/release-notes/rl-2511.section.md +++ b/nixos/doc/manual/release-notes/rl-2511.section.md @@ -4,6 +4,8 @@ +- `nixos-rebuild-ng`, a full rewrite of `nixos-rebuild` in Python, is enabled by default from this release. You can disable it by setting [](#opt-system.rebuild.enableNg) 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. + - Secure boot support can now be enabled for the Limine bootloader through {option}`boot.loader.limine.secureBoot.enable`. Bootloader install script signs the bootloader, then kernels are hashed during system rebuild and written to a config. This allows Limine to boot only the kernels installed through NixOS system. ## New Modules {#sec-release-25.11-new-modules} diff --git a/nixos/modules/installer/tools/tools.nix b/nixos/modules/installer/tools/tools.nix index bbbe0a7ed4a9..b45c51e98192 100644 --- a/nixos/modules/installer/tools/tools.nix +++ b/nixos/modules/installer/tools/tools.nix @@ -280,6 +280,7 @@ in }; options.system.rebuild.enableNg = lib.mkEnableOption "" // { + default = true; description = '' Whether to use ‘nixos-rebuild-ng’ in place of ‘nixos-rebuild’, the Python-based re-implementation of the original in Bash. @@ -330,6 +331,12 @@ in config = { documentation.man.man-db.skipPackages = [ nixos-version ]; + warnings = lib.optional (!config.system.disableInstallerTools && !config.system.rebuild.enableNg) '' + 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'. + ''; + # These may be used in auxiliary scripts (ie not part of toplevel), so they are defined unconditionally. system.build = { inherit nixos-generate-config nixos-install; From 9b50226bf5d38d50705c6ba0e48d1e2bf7cf6710 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 10 Jun 2025 18:35:06 +0100 Subject: [PATCH 2/3] nixos/tests: set `withNg = false` in nixos-rebuild-install-bootloader --- nixos/tests/all-tests.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index aedc99b1a7e4..134dc973183d 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -942,7 +942,7 @@ in nixos-generate-config = runTest ./nixos-generate-config.nix; nixos-rebuild-install-bootloader = handleTestOn [ "x86_64-linux" - ] ./nixos-rebuild-install-bootloader.nix { }; + ] ./nixos-rebuild-install-bootloader.nix { withNg = false; }; nixos-rebuild-install-bootloader-ng = handleTestOn [ "x86_64-linux" ] ./nixos-rebuild-install-bootloader.nix { withNg = true; }; From 3c0a57d172fbf5af8082054bccb0ad1b04e36ad6 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 10 Jun 2025 18:50:40 +0100 Subject: [PATCH 3/3] nixos-rebuild-ng: clean-up README.md --- pkgs/by-name/ni/nixos-rebuild-ng/README.md | 34 ---------------------- 1 file changed, 34 deletions(-) diff --git a/pkgs/by-name/ni/nixos-rebuild-ng/README.md b/pkgs/by-name/ni/nixos-rebuild-ng/README.md index 10bd1a90e9d4..bcbadeee301b 100644 --- a/pkgs/by-name/ni/nixos-rebuild-ng/README.md +++ b/pkgs/by-name/ni/nixos-rebuild-ng/README.md @@ -35,40 +35,6 @@ an attempt of the rewrite. currently depends on `jq` for JSON parsing, while Python has `json` in standard library -## Do's and Don'ts - -- Do: be as much of a drop-in replacement as possible -- Do: fix obvious bugs -- Do: improvements that are non-breaking -- Don't: change logic in breaking ways even if this would be an improvement - -## How to use - -If you want to use `nixos-rebuild-ng` without replacing `nixos-rebuild`, add the -following to your NixOS configuration: - -```nix -{ pkgs, ... }: -{ - environment.systemPackages = [ pkgs.nixos-rebuild-ng ]; -} -``` - -And use `nixos-rebuild-ng` instead of `nixos-rebuild`. - -If you want to completely replace `nixos-rebuild` with `nixos-rebuild-ng`, add -the following to your NixOS configuration: - -```nix -{ ... }: -{ - system.rebuild.enableNg = true; -} -``` - -This will set `config.system.build.nixos-rebuild` to `nixos-rebuild-ng`, so -all tools that expect it in that location should work. - ## Development Run: