From c09622bb8d12c8a5380dc81591da827a0d280174 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sat, 21 Jun 2025 12:06:23 +0200 Subject: [PATCH] nixos-rebuild-ng: add passthru.tests for lix Note that the code currently assumes that checking >= 2.18 on the version of an opaque package is enough which works for many things as it is the fork point of Lix. However, future changes may need to reevaluate whether it is enough for every check (should more conditional code be added). --- pkgs/by-name/ni/nixos-rebuild-ng/package.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/by-name/ni/nixos-rebuild-ng/package.nix b/pkgs/by-name/ni/nixos-rebuild-ng/package.nix index f02be7888d09..e29b7d924149 100644 --- a/pkgs/by-name/ni/nixos-rebuild-ng/package.nix +++ b/pkgs/by-name/ni/nixos-rebuild-ng/package.nix @@ -18,6 +18,7 @@ # passthru.tests nixosTests, nixVersions, + lixPackageSets, nixos-rebuild-ng, }: let @@ -26,6 +27,8 @@ let # implemented in newer versions of Nix, but not necessary 2.18. # However, Lix is a fork of Nix 2.18, so this looks like a good version # to cut specific functionality. + # ATTN: This currently doesn't disambiguate between Nix and Lix, so using this + # in a conditional needs careful checking against both Nix implementations. withNix218 = lib.versionAtLeast nix.version "2.18"; in python3Packages.buildPythonApplication rec { @@ -118,6 +121,14 @@ python3Packages.buildPythonApplication rec { # oldest / minimum supported version in nixpkgs nix = nixVersions.nix_2_3; }; + with_lix_latest = nixos-rebuild-ng.override { + # oldest / minimum supported version in nixpkgs + nix = lixPackageSets.latest.lix; + }; + with_lix_stable = nixos-rebuild-ng.override { + # oldest / minimum supported version in nixpkgs + nix = lixPackageSets.stable.lix; + }; inherit (nixosTests) nixos-rebuild-install-bootloader-ng