From 7366cd77ccdeee80b1edd1b4621f9c5daa88e42d Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Mon, 24 Jan 2022 18:03:13 -0800 Subject: [PATCH 1/3] nix: 2.5.1 -> 2.6.0 --- pkgs/tools/package-management/nix/default.nix | 18 +++++++++++++++++- pkgs/top-level/all-packages.nix | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index 4cf6ef23b654..cff152371bb9 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -229,7 +229,7 @@ in rec { nix = nixStable; - nixStable = nix_2_5; + nixStable = nix_2_6; nix_2_3 = callPackage common (rec { pname = "nix"; @@ -280,6 +280,22 @@ in rec { inherit storeDir stateDir confDir; }); + nix_2_6 = callPackage common (rec { + pname = "nix"; + version = "2.6.0"; + + src = fetchFromGitHub { + owner = "NixOS"; + repo = "nix"; + rev = version; + sha256 = "sha256-xEPeMcNJVOeZtoN+d+aRwolpW8mFSEQx76HTRdlhPhg="; + }; + + boehmgc = boehmgc_nix; + + inherit storeDir stateDir confDir; + }); + nixUnstable = lib.lowPrio (callPackage common rec { pname = "nix"; version = "2.6${suffix}"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d3bf1f622988..34785c815696 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -33091,6 +33091,7 @@ with pkgs; nix_2_3 nix_2_4 nix_2_5 + nix_2_6 nixUnstable; nixStatic = pkgsStatic.nix; From fd7729c1451e66c48d3cef89fc8106d6ca2bb978 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Mon, 24 Jan 2022 18:33:38 -0800 Subject: [PATCH 2/3] nix: introduce buildNix function to avoid so much copy-pasting --- pkgs/tools/package-management/nix/default.nix | 103 +++++++----------- 1 file changed, 40 insertions(+), 63 deletions(-) diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index cff152371bb9..f291e90971dc 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -225,95 +225,72 @@ common = sha256 = "sha256-SPnam4xNIjbMgnq6IP1AaM1V62X0yZNo4DEVmI8sHOo="; }; -in rec { + buildNix = + { version, suffix ? "" + , src ? null, sha256 ? null + , boehmgc ? boehmgc_nix, patches ? [ ] + }: + assert (src == null) -> (sha256 != null); + assert (sha256 == null) -> (src != null); + callPackage common { + pname = "nix"; + version = "${version}${suffix}"; + inherit suffix; + src = + if src != null + then src + else fetchFromGitHub { + owner = "NixOS"; + repo = "nix"; + rev = version; + inherit sha256; + }; + + inherit boehmgc patches; + inherit storeDir stateDir confDir; + }; + +in rec { nix = nixStable; nixStable = nix_2_6; - nix_2_3 = callPackage common (rec { - pname = "nix"; + nix_2_3 = buildNix rec { version = "2.3.16"; src = fetchurl { - url = "https://nixos.org/releases/nix/${pname}-${version}/${pname}-${version}.tar.xz"; + url = "https://nixos.org/releases/nix/nix-${version}/nix-${version}.tar.xz"; sha256 = "sha256-fuaBtp8FtSVJLSAsO+3Nne4ZYLuBj2JpD2xEk7fCqrw="; }; - boehmgc = boehmgc_nix_2_3; + }; - inherit storeDir stateDir confDir; - }); - - nix_2_4 = callPackage common (rec { - pname = "nix"; + nix_2_4 = buildNix { version = "2.4"; - - src = fetchFromGitHub { - owner = "NixOS"; - repo = "nix"; - rev = version; - sha256 = "sha256-op48CCDgLHK0qV1Batz4Ln5FqBiRjlE6qHTiZgt3b6k="; - }; - - boehmgc = boehmgc_nix; - + sha256 = "sha256-op48CCDgLHK0qV1Batz4Ln5FqBiRjlE6qHTiZgt3b6k="; patches = [ installNlohmannJsonPatch ]; + }; - inherit storeDir stateDir confDir; - }); - - nix_2_5 = callPackage common (rec { - pname = "nix"; + nix_2_5 = buildNix { version = "2.5.1"; - - src = fetchFromGitHub { - owner = "NixOS"; - repo = "nix"; - rev = version; - sha256 = "sha256-GOsiqy9EaTwDn2PLZ4eFj1VkXcBUbqrqHehRE9GuGdU="; - }; - - boehmgc = boehmgc_nix; - + sha256 = "sha256-GOsiqy9EaTwDn2PLZ4eFj1VkXcBUbqrqHehRE9GuGdU="; patches = [ installNlohmannJsonPatch ]; + }; - inherit storeDir stateDir confDir; - }); - - nix_2_6 = callPackage common (rec { - pname = "nix"; + nix_2_6 = buildNix { version = "2.6.0"; + sha256 = "sha256-xEPeMcNJVOeZtoN+d+aRwolpW8mFSEQx76HTRdlhPhg="; + }; - src = fetchFromGitHub { - owner = "NixOS"; - repo = "nix"; - rev = version; - sha256 = "sha256-xEPeMcNJVOeZtoN+d+aRwolpW8mFSEQx76HTRdlhPhg="; - }; - - boehmgc = boehmgc_nix; - - inherit storeDir stateDir confDir; - }); - - nixUnstable = lib.lowPrio (callPackage common rec { - pname = "nix"; - version = "2.6${suffix}"; + nixUnstable = lib.lowPrio (buildNix rec { + version = "2.6"; suffix = "pre20211217_${lib.substring 0 7 src.rev}"; - src = fetchFromGitHub { owner = "NixOS"; repo = "nix"; rev = "6e6e998930f0d7361d64644eb37d9134e74e8501"; sha256 = "sha256-RZSWOJUPkXIlMNYMC5a+WNrOjpqAHyhzyqD57BGfNY8="; }; - - boehmgc = boehmgc_nix; - patches = [ installNlohmannJsonPatch ]; - - inherit storeDir stateDir confDir; - }); - } From b5fc7509659c59884b806dfcc8a26735bd281ae2 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Mon, 24 Jan 2022 18:44:21 -0800 Subject: [PATCH 3/3] nixUnstable: 2.6pre20211217 -> 2.7pre20220124 --- pkgs/tools/package-management/nix/default.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index f291e90971dc..bf2186a99faa 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -283,14 +283,13 @@ in rec { }; nixUnstable = lib.lowPrio (buildNix rec { - version = "2.6"; - suffix = "pre20211217_${lib.substring 0 7 src.rev}"; + version = "2.7"; + suffix = "pre20220124_${lib.substring 0 7 src.rev}"; src = fetchFromGitHub { owner = "NixOS"; repo = "nix"; - rev = "6e6e998930f0d7361d64644eb37d9134e74e8501"; - sha256 = "sha256-RZSWOJUPkXIlMNYMC5a+WNrOjpqAHyhzyqD57BGfNY8="; + rev = "0a70b37b5694c769fb855c1afe7642407d1db64f"; + sha256 = "sha256-aOM9MPNlnWNMobx4CuD4JIXH2poRlG8AKkuxY7FysWg="; }; - patches = [ installNlohmannJsonPatch ]; }); }