nixpkgs/pkgs/tools/package-management/nix/default.nix

88 lines
2.2 KiB
Nix
Raw Normal View History

2022-01-25 07:07:22 +00:00
{ lib
, boehmgc
, callPackage
, fetchFromGitHub
, fetchurl
, Security
, storeDir ? "/nix/store"
, stateDir ? "/nix/var"
2017-05-03 13:04:52 +00:00
, confDir ? "/etc"
}:
let
2022-01-25 07:07:22 +00:00
boehmgc_nix_2_3 = boehmgc.override { enableLargeConfig = true; };
2021-12-20 13:48:02 +00:00
boehmgc_nix = boehmgc_nix_2_3.overrideAttrs (drv: {
2022-01-25 07:07:22 +00:00
# Part of the GC solution in https://github.com/NixOS/nix/pull/4944
patches = (drv.patches or [ ]) ++ [ ./patches/boehmgc-coroutine-sp-fallback.patch ];
});
buildNix =
2022-01-25 07:07:22 +00:00
{ version
, suffix ? ""
, src ? null
, sha256 ? null
, boehmgc ? boehmgc_nix
, patches ? [ ]
}:
assert (src == null) -> (sha256 != null);
assert (sha256 == null) -> (src != null);
callPackage ./common.nix {
inherit version suffix;
src =
if src != null
then src
else fetchFromGitHub {
owner = "NixOS";
repo = "nix";
rev = version;
inherit sha256;
};
2022-01-25 07:07:22 +00:00
inherit boehmgc patches Security;
inherit storeDir stateDir confDir;
};
2022-01-26 18:44:03 +00:00
in rec {
stable = nix_2_6;
2022-01-26 18:44:03 +00:00
nix_2_6 = buildNix {
version = "2.6.0";
sha256 = "sha256-xEPeMcNJVOeZtoN+d+aRwolpW8mFSEQx76HTRdlhPhg=";
};
2021-11-11 10:45:26 +00:00
nix_2_5 = buildNix {
2021-12-20 13:42:30 +00:00
version = "2.5.1";
sha256 = "sha256-GOsiqy9EaTwDn2PLZ4eFj1VkXcBUbqrqHehRE9GuGdU=";
2022-01-25 07:07:22 +00:00
# https://github.com/NixOS/nix/pull/5536
patches = [ ./patches/install-nlohmann_json-headers.patch ];
};
2021-11-11 10:45:26 +00:00
2022-01-26 18:44:03 +00:00
nix_2_4 = buildNix {
version = "2.4";
sha256 = "sha256-op48CCDgLHK0qV1Batz4Ln5FqBiRjlE6qHTiZgt3b6k=";
# https://github.com/NixOS/nix/pull/5537
patches = [ ./patches/install-nlohmann_json-headers.patch ];
};
nix_2_3 = buildNix rec {
version = "2.3.16";
src = fetchurl {
url = "https://nixos.org/releases/nix/nix-${version}/nix-${version}.tar.xz";
sha256 = "sha256-fuaBtp8FtSVJLSAsO+3Nne4ZYLuBj2JpD2xEk7fCqrw=";
};
boehmgc = boehmgc_nix_2_3;
};
2022-01-25 02:03:13 +00:00
2022-01-26 18:44:03 +00:00
unstable = lib.lowPrio (buildNix rec {
version = "2.7";
suffix = "pre20220124_${lib.substring 0 7 src.rev}";
src = fetchFromGitHub {
owner = "NixOS";
repo = "nix";
rev = "0a70b37b5694c769fb855c1afe7642407d1db64f";
sha256 = "sha256-aOM9MPNlnWNMobx4CuD4JIXH2poRlG8AKkuxY7FysWg=";
2016-02-12 15:10:18 +00:00
};
});
}