From 62d9a325a2daff270adb2876ec8f239cdd762a66 Mon Sep 17 00:00:00 2001 From: Michael Hoang Date: Thu, 20 Mar 2025 15:48:01 +0900 Subject: [PATCH] checks: use `pkgs.nixVersions.latest` until `pkgs.nix` is 2.26+ --- checks/installation-without-system/flake-module.nix | 11 ++++++++--- checks/installation/flake-module.nix | 11 ++++++++--- pkgs/clan-cli/default.nix | 10 ++++++++-- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/checks/installation-without-system/flake-module.nix b/checks/installation-without-system/flake-module.nix index 1d5883ca7..cc58c8ad1 100644 --- a/checks/installation-without-system/flake-module.nix +++ b/checks/installation-without-system/flake-module.nix @@ -117,11 +117,16 @@ pkgs.bubblewrap ] ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs); closureInfo = pkgs.closureInfo { rootPaths = dependencies; }; - # with nix 2.24 we get: + # with Nix 2.24 we get: # vm-test-run-test-installation> client # error: sized: unexpected end-of-file # vm-test-run-test-installation> client # error: unexpected end-of-file - # This seems to be fixed with nix 2.26 - nixPackage = pkgs.nixVersions.nix_2_26; + # This seems to be fixed with Nix 2.26 + # Remove this line once `pkgs.nix` is 2.26+ + nixPackage = + assert + lib.versionOlder pkgs.nix.version "2.26" + && lib.versionAtLeast pkgs.nixVersions.latest.version "2.26"; + pkgs.nixVersions.latest; in { # On aarch64-linux, hangs on reboot with after installation: diff --git a/checks/installation/flake-module.nix b/checks/installation/flake-module.nix index 4b360ece9..311c868ca 100644 --- a/checks/installation/flake-module.nix +++ b/checks/installation/flake-module.nix @@ -99,11 +99,16 @@ ] ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs); closureInfo = pkgs.closureInfo { rootPaths = dependencies; }; - # with nix 2.24 we get: + # with Nix 2.24 we get: # vm-test-run-test-installation> client # error: sized: unexpected end-of-file # vm-test-run-test-installation> client # error: unexpected end-of-file - # This seems to be fixed with nix 2.26 - nixPackage = pkgs.nixVersions.nix_2_26; + # This seems to be fixed with Nix 2.26 + # Remove this line once `pkgs.nix` is 2.26+ + nixPackage = + assert + lib.versionOlder pkgs.nix.version "2.26" + && lib.versionAtLeast pkgs.nixVersions.latest.version "2.26"; + pkgs.nixVersions.latest; in { # On aarch64-linux, hangs on reboot with after installation: diff --git a/pkgs/clan-cli/default.nix b/pkgs/clan-cli/default.nix index ffe8e5087..0d31b9bd3 100644 --- a/pkgs/clan-cli/default.nix +++ b/pkgs/clan-cli/default.nix @@ -166,8 +166,14 @@ pythonRuntime.pkgs.buildPythonApplication { buildInputs = [ pkgs.bash pkgs.coreutils - # Use newer nix versions to get more insights on profile creation race condition - nixVersions.nix_2_26 + # looks like Nix 2.26 fixes the profile creation race condition we were running into on Nix 2.24 + # Switch this back to `pkgs.nix` when `pkgs.nix` is Nix 2.26+ + ( + assert + lib.versionOlder pkgs.nix.version "2.26" + && lib.versionAtLeast pkgs.nixVersions.latest.version "2.26"; + pkgs.nixVersions.latest + ) ]; closureInfo = pkgs.closureInfo { rootPaths = [