From f5f59e0c4ad3d70596921d102dc0919c207d1a67 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Tue, 16 Jun 2026 06:36:40 +0100 Subject: [PATCH] lib/systems: gate linux-kernel assertion behind oldestSupportedRelease A platform elaborated by another supported revision of Nixpkgs would trip the assertion when it is re-elaborated. Avoid this, by checking `oldestSupportedReleaseIsAtLeast 2511`, as 25.11 is the version that stopped adding `linux-kernel` to elaborated systems. --- lib/systems/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 53c095711aef..bbdbc929e2c4 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -17,6 +17,10 @@ let inherit (lib.strings) toJSON; + inherit (lib.trivial) + oldestSupportedReleaseIsAtLeast + ; + doubles = import ./doubles.nix { inherit lib; }; parse = import ./parse.nix { inherit lib; }; inspect = import ./inspect.nix { inherit lib; }; @@ -690,9 +694,12 @@ let }; }; in - # TODO: Remove in 27.05. + # Platforms elaborated by pre-26.11 Nixpkgs will include the `linux-kernel` attr, + # so we can't assert its absence until 26.11 is the oldest supported release. + # Assertion will activate during the 27.05 cycle, when 26.05 support ends. + # TODO: Remove assertion in the 27.11 cycle. assert - args ? linux-kernel + oldestSupportedReleaseIsAtLeast 2611 && args ? linux-kernel -> throw "lib.systems.elaborate: linux-kernel has been removed; see the 26.11 release notes"; assert final.useAndroidPrebuilt -> final.isAndroid;