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).
This commit is contained in:
sternenseemann
2025-06-21 12:25:23 +02:00
parent c20ef42f01
commit c09622bb8d
@@ -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