Skip to content

Commit a8e3363

Browse files
balsoftkolloch
authored andcommitted
tools.nix: compare Nix version with 2.3
Previously, the new Nix release would be called 3.0. Now the version is 2.4pre, which means that matching the major version with 3 to determine if new features are available is incorrect.
1 parent ca777b2 commit a8e3363

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,9 @@ rec {
245245
value = builtins.readFile hash;
246246
};
247247

248+
# Fetching git submodules with builtins.fetchGit is only supported in nix > 2.3
248249
extraHashes = lib.optionalAttrs
249-
((builtins.elemAt (builtins.splitVersion builtins.nixVersion) 0) == "3")
250+
(builtins.compareVersions builtins.nixVersion "2.3" == 1)
250251
(builtins.listToAttrs (map mkGitHash unhashedGitDeps));
251252

252253
packages =

0 commit comments

Comments
 (0)