From fadc273dd040dacb210971909589cdc77ac118db Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Mon, 23 Feb 2026 07:56:56 +0100 Subject: [PATCH] nixos/release-notes: explain the new system.nix file --- .../manual/release-notes/rl-2605.section.md | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/nixos/doc/manual/release-notes/rl-2605.section.md b/nixos/doc/manual/release-notes/rl-2605.section.md index cd59164990eb..622ca41db4e8 100644 --- a/nixos/doc/manual/release-notes/rl-2605.section.md +++ b/nixos/doc/manual/release-notes/rl-2605.section.md @@ -4,6 +4,32 @@ +- The system.nix file has been added has an alternative entry point to configuration.nix (and flake.nix) that allows to configure NixOS without using `nix-channel`. + This file must evaluate to a NixOS system derivation or an attribute set of such derivations, in which case the attribute to build has to be selected with the `--attr` option of `nixos-rebuild` or `nixos-install`. + For example, + ```nix + # system.nix + let + # Pinned Nixpkgs archive + # + # Use `curl -I https://channels.nixos.org/nixos-26.05` to get the + # latest commit of the stable channel and `nix-prefetch-url --unpack` + # to compute its sha256 hash. + nixpkgs = builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/c217913993d6.tar.gz"; + sha256 = "026mprs324330pfazlgbw987qmsa8ligglarvqbcxzig2kgw0lqg"; + }; + in + import "${nixpkgs}/nixos" { + # Build NixOS using an external configuration.nix file, + # or directly set your options here + configuration = ./configuration.nix; + } + ``` + + The default location of system.nix is `/etc/nixos/system.nix` and can be changed by setting the `` search path. + `nixos-rebuild` and `nixos-install` can now also load a system.nix file in the current directory (only if `--attr` is used) or from a directory specified with `--file`. + - The default kernel package has been updated from 6.12 to 6.18. All supported kernels remain available. ## New Modules {#sec-release-26.05-new-modules}