diff --git a/nixos/modules/installer/tools/nix-fallback-paths.nix b/nixos/modules/installer/tools/nix-fallback-paths.nix index bd09724ebfa2..2df7b1ae2d2d 100644 --- a/nixos/modules/installer/tools/nix-fallback-paths.nix +++ b/nixos/modules/installer/tools/nix-fallback-paths.nix @@ -1,7 +1,7 @@ { - x86_64-linux = "/nix/store/6g4fla3vkcxihph282a0v3cd10709y7c-nix-2.9.1"; - i686-linux = "/nix/store/j143221z44469zx21f5m9a47x7y1jpr5-nix-2.9.1"; - aarch64-linux = "/nix/store/c4z3vy1sgm49la8bvmdrrpssgk4iw2nk-nix-2.9.1"; - x86_64-darwin = "/nix/store/cqdwb7khf6zg94bz7lnvfjqx6z775qaw-nix-2.9.1"; - aarch64-darwin = "/nix/store/1brkxcs287n1px2i4fq39l7h51hjv0f8-nix-2.9.1"; + x86_64-linux = "/nix/store/qx384jvdjk2vzd2wpr9pmkcimk12g3as-nix-2.10.2"; + i686-linux = "/nix/store/8mhknp6flnlnbj11zmskb3972ia1mdl5-nix-2.10.2"; + aarch64-linux = "/nix/store/digzqw2vgdsg0fdzf7qlwbl4xii9i458-nix-2.10.2"; + x86_64-darwin = "/nix/store/w62jxmpvjykw707qr9s5nxi90r35xqmd-nix-2.10.2"; + aarch64-darwin = "/nix/store/6pjrn22f57n854x88a9kkbqnxw1yai73-nix-2.10.2"; } diff --git a/pkgs/tools/package-management/nix/common.nix b/pkgs/tools/package-management/nix/common.nix index 25684ef3a7ae..0d42c9e2c71a 100644 --- a/pkgs/tools/package-management/nix/common.nix +++ b/pkgs/tools/package-management/nix/common.nix @@ -11,6 +11,7 @@ let atLeast24 = lib.versionAtLeast version "2.4pre"; atLeast25 = lib.versionAtLeast version "2.5pre"; atLeast27 = lib.versionAtLeast version "2.7pre"; + atLeast210 = lib.versionAtLeast version "2.10pre"; in { stdenv , autoconf-archive @@ -176,6 +177,7 @@ self = stdenv.mkDerivation { installFlags = [ "sysconfdir=$(out)/etc" ]; doInstallCheck = true; + installCheckTarget = if atLeast210 then "installcheck" else null; # socket path becomes too long otherwise preInstallCheck = lib.optionalString stdenv.isDarwin '' diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index 24e93a6d66e2..d7a6e4e80670 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -47,39 +47,13 @@ in lib.makeExtensible (self: { }; }).override { boehmgc = boehmgc-nix_2_3; }; - nix_2_4 = common { - version = "2.4"; - sha256 = "sha256-op48CCDgLHK0qV1Batz4Ln5FqBiRjlE6qHTiZgt3b6k="; - # https://github.com/NixOS/nix/pull/5537 - patches = [ ./patches/install-nlohmann_json-headers.patch ]; - }; + nix_2_4 = throw "nixVersions.nix_2_4 has been removed"; - nix_2_5 = common { - version = "2.5.1"; - sha256 = "sha256-GOsiqy9EaTwDn2PLZ4eFj1VkXcBUbqrqHehRE9GuGdU="; - # https://github.com/NixOS/nix/pull/5536 - patches = [ ./patches/install-nlohmann_json-headers.patch ]; - }; + nix_2_5 = throw "nixVersions.nix_2_5 has been removed"; - nix_2_6 = common { - version = "2.6.1"; - sha256 = "sha256-E9iQ7f+9Z6xFcUvvfksTEfn8LsDfzmwrcRBC//5B3V0="; - }; + nix_2_6 = throw "nixVersions.nix_2_6 has been removed"; - nix_2_7 = common { - version = "2.7.0"; - sha256 = "sha256-m8tqCS6uHveDon5GSro5yZor9H+sHeh+v/veF1IGw24="; - patches = [ - # remove when there's a 2.7.1 release - # https://github.com/NixOS/nix/pull/6297 - # https://github.com/NixOS/nix/issues/6243 - # https://github.com/NixOS/nixpkgs/issues/163374 - (fetchpatch { - url = "https://github.com/NixOS/nix/commit/c9afca59e87afe7d716101e6a75565b4f4b631f7.patch"; - sha256 = "sha256-xz7QnWVCI12lX1+K/Zr9UpB93b10t1HS9y/5n5FYf8Q="; - }) - ]; - }; + nix_2_7 = throw "nixVersions.nix_2_7 has been removed"; nix_2_8 = common { version = "2.8.1"; @@ -87,19 +61,17 @@ in lib.makeExtensible (self: { }; nix_2_9 = common { - version = "2.9.1"; - sha256 = "sha256-qNL3lQPBsnStkru3j1ajN/H+knXI+X3dku8/dBfSw3g="; - patches = [ - # add missing --git-dir flags - # remove once 2.9.2 is out - (fetchpatch { - url = "https://github.com/NixOS/nix/commit/1a994cc35b33dcfd484e7a96be0e76e23bfb9029.patch"; - sha256 = "sha256-7rDlqWRSVPijbvrTm4P+YykbMWyJryorXqGLEgg8/Wo="; - }) - ]; + version = "2.9.2"; + sha256 = "sha256-uZCaBo9rdWRO/AlQMvVVjpAwzYijB2H5KKQqde6eHkg="; }; - stable = self.nix_2_9; + nix_2_10 = common { + version = "2.10.2"; + sha256 = "sha256-/8zlkXoZEZd+LgJq5xw8h+u2STqeKLrGTARZklE3CP8="; + patches = [ ./patches/flaky-tests.patch ]; + }; + + stable = self.nix_2_10; unstable = self.stable; }) diff --git a/pkgs/tools/package-management/nix/patches/flaky-tests.patch b/pkgs/tools/package-management/nix/patches/flaky-tests.patch new file mode 100644 index 000000000000..3684b09f6ffa --- /dev/null +++ b/pkgs/tools/package-management/nix/patches/flaky-tests.patch @@ -0,0 +1,12 @@ +diff --git a/mk/run_test.sh b/mk/run_test.sh +index 7e95df2ac..58420c317 100755 +--- a/mk/run_test.sh ++++ b/mk/run_test.sh +@@ -27,7 +27,6 @@ run_test "$1" + # appear randomly without anyone knowing why. + # See https://github.com/NixOS/nix/issues/3605 for more info + if [[ $status -ne 0 && $status -ne 99 && \ +- "$(uname)" == "Darwin" && \ + "$log" =~ "unexpected EOF reading a line" \ + ]]; then + echo "$post_run_msg [${yellow}FAIL$normal] (possibly flaky, so will be retried)" diff --git a/pkgs/tools/package-management/nix/patches/install-nlohmann_json-headers.patch b/pkgs/tools/package-management/nix/patches/install-nlohmann_json-headers.patch deleted file mode 100644 index 8b92de229032..000000000000 --- a/pkgs/tools/package-management/nix/patches/install-nlohmann_json-headers.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 3884f7a69a57d8ecfcbcaae476ec2ff53ffbd549 Mon Sep 17 00:00:00 2001 -From: Robert Hensing -Date: Thu, 11 Nov 2021 11:03:21 +0100 -Subject: [PATCH] Install nlohmann_json headers - -These headers are included by the libexpr, libfetchers, libstore -and libutil headers. -Considering that these are vendored sources, Nix should expose them, -as it is not a good idea for reverse dependencies to rely on a -potentially different source that can go out of sync. ---- - Makefile | 1 + - src/nlohmann/local.mk | 2 ++ - 2 files changed, 3 insertions(+) - create mode 100644 src/nlohmann/local.mk - -diff --git a/Makefile b/Makefile -index 5040d288485..e6ce50cbdb7 100644 ---- a/Makefile -+++ b/Makefile -@@ -10,6 +10,7 @@ makefiles = \ - src/libexpr/local.mk \ - src/libcmd/local.mk \ - src/nix/local.mk \ -+ src/nlohmann/local.mk \ - src/resolve-system-dependencies/local.mk \ - scripts/local.mk \ - misc/bash/local.mk \ -diff --git a/src/nlohmann/local.mk b/src/nlohmann/local.mk -new file mode 100644 -index 00000000000..63c427e000e ---- /dev/null -+++ b/src/nlohmann/local.mk -@@ -0,0 +1,2 @@ -+$(foreach i, $(wildcard src/nlohmann/*.hpp), \ -+ $(eval $(call install-file-in, $(i), $(includedir)/nlohmann, 0644))) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 935a29c3fc09..24b62cdda7c8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16470,7 +16470,7 @@ with pkgs; rman = callPackage ../development/tools/misc/rman { }; - rnix-lsp = callPackage ../development/tools/rnix-lsp { }; + rnix-lsp = callPackage ../development/tools/rnix-lsp { nix = nixVersions.nix_2_9; }; rnginline = with python3Packages; toPythonApplication rnginline;