Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix: put each version in a separate file #211172

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 37 additions & 61 deletions pkgs/tools/package-management/nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -119,72 +119,48 @@ let
hash = "sha256-YrmFkVpwPreiig1/BsP+DInpTdQrPmS7bEY0WUGpw+c=";
};

in lib.makeExtensible (self: ({
nix_2_3 = (common rec {
version = "2.3.16";
src = fetchurl {
url = "https://nixos.org/releases/nix/nix-${version}/nix-${version}.tar.xz";
hash = "sha256-fuaBtp8FtSVJLSAsO+3Nne4ZYLuBj2JpD2xEk7fCqrw=";
};
patches = [
patch-monitorfdhup
];
}).override { boehmgc = boehmgc-nix_2_3; };

nix_2_10 = common {
version = "2.10.3";
hash = "sha256-B9EyDUz/9tlcWwf24lwxCFmkxuPTVW7HFYvp0C4xGbc=";
patches = [
./patches/flaky-tests.patch
patch-non-existing-output
patch-monitorfdhup
patch-sqlite-exception
];
};
in lib.makeExtensible (self: {

# Please keep the attrset containing these `throw`s *before* the
# `versions` attrset, so the `throw` only occurs if the file is
# missing.
#
# This allows developers to resurrect old versions, at their own
# risk, by reverting the deletion of the $major.$minor.nix file.
# Unlike a file edit, reverting a deletion won't cause a merge
# conflict with every subsequent rebase that touches nearby
# lines of code.

nix_2_11 = common {
version = "2.11.1";
hash = "sha256-qCV65kw09AG+EkdchDPq7RoeBznX0Q6Qa4yzPqobdOk=";
patches = [
./patches/flaky-tests.patch
patch-non-existing-output
patch-monitorfdhup
patch-sqlite-exception
];
};
nix_2_4 = throw "nixVersions.nix_2_4 has been removed";

nix_2_12 = common {
version = "2.12.1";
hash = "sha256-GmHKhq0uFtdOiJnuBwj2YwlZjvh6YTkfQZgeu4e0dLU=";
patches = [
./patches/flaky-tests.patch
patch-monitorfdhup
patch-sqlite-exception
];
};
nix_2_5 = throw "nixVersions.nix_2_5 has been removed";

nix_2_13 = common {
version = "2.13.3";
hash = "sha256-jUc2ccTR8f6MGY2pUKgujm+lxSPNGm/ZAP+toX+nMNc=";
patches = [
patch-fix-aarch64-darwin-static
];
};
nix_2_6 = throw "nixVersions.nix_2_6 has been removed";

nix_2_14 = common {
version = "2.14.1";
hash = "sha256-5aCmGZbsFcLIckCDfvnPD4clGPQI7qYAqHYlttN/Wkg=";
};
nix_2_7 = throw "nixVersions.nix_2_7 has been removed";

nix_2_15 = common {
version = "2.15.1";
hash = "sha256-o7bxsNeq2LF6/dTl+lT2k50bSItkID80/uoZYVtlxro=";
};
nix_2_8 = throw "nixVersions.nix_2_8 has been removed";

nix_2_16 = common {
version = "2.16.1";
hash = "sha256-/XCWa2osNFIpPC5MkxlX6qTZf/DaTLwS3LWN0SRFiuU=";
};
nix_2_9 = throw "nixVersions.nix_2_9 has been removed";

} //

(let
# Given a version number, produce a derivation for that Nix version.
version_to_derivation = version:
callPackage (./versions + "/${version}") {
inherit common patch-sqlite-exception boehmgc-nix_2_3 patch-monitorfdhup patch-fix-aarch64-darwin-static;
};
versions = lib.attrNames (builtins.readDir ./versions);
version_to_nameValuePair_drv = version:
lib.nameValuePair
"nix_${lib.replaceStrings ["."] ["_"] version}"
(version_to_derivation version);

in
lib.listToAttrs (map version_to_nameValuePair_drv versions))

// {

# The minimum Nix version supported by Nixpkgs
# Note that some functionality *might* have been backported into this Nix version,
Expand Down Expand Up @@ -218,4 +194,4 @@ in lib.makeExtensible (self: ({
nix_2_8 = throw "nixVersions.nix_2_8 has been removed";

nix_2_9 = throw "nixVersions.nix_2_9 has been removed";
}))
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
From 3884f7a69a57d8ecfcbcaae476ec2ff53ffbd549 Mon Sep 17 00:00:00 2001
From: Robert Hensing <robert@roberthensing.nl>
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)))
22 changes: 22 additions & 0 deletions pkgs/tools/package-management/nix/versions/2.10/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ common
, fetchpatch
, patch-sqlite-exception
, patch-monitorfdhup
, ...
}:

common {
version = "2.10.3";
hash = "sha256-B9EyDUz/9tlcWwf24lwxCFmkxuPTVW7HFYvp0C4xGbc=";
patches = [
../../patches/flaky-tests.patch
(fetchpatch {
# https://github.com/NixOS/nix/pull/7283
name = "fix-requires-non-existing-output.patch";
url = "https://github.com/NixOS/nix/commit/3ade5f5d6026b825a80bdcc221058c4f14e10a27.patch";
hash = "sha256-s1ybRFCjQaSGj7LKu0Z5g7UiHqdJGeD+iPoQL0vaiS0=";
})
patch-sqlite-exception
patch-monitorfdhup
];
}
22 changes: 22 additions & 0 deletions pkgs/tools/package-management/nix/versions/2.11/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ common
, fetchpatch
, patch-sqlite-exception
, patch-monitorfdhup
, ...
}:

common {
version = "2.11.1";
hash = "sha256-qCV65kw09AG+EkdchDPq7RoeBznX0Q6Qa4yzPqobdOk=";
patches = [
../../patches/flaky-tests.patch
(fetchpatch {
# https://github.com/NixOS/nix/pull/7283
name = "fix-requires-non-existing-output.patch";
url = "https://github.com/NixOS/nix/commit/3ade5f5d6026b825a80bdcc221058c4f14e10a27.patch";
hash = "sha256-s1ybRFCjQaSGj7LKu0Z5g7UiHqdJGeD+iPoQL0vaiS0=";
})
patch-sqlite-exception
patch-monitorfdhup
];
}
15 changes: 15 additions & 0 deletions pkgs/tools/package-management/nix/versions/2.12/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{ common
, patch-sqlite-exception
, patch-monitorfdhup
, ...
}:

common {
version = "2.12.0";
hash = "sha256-sQ9C101CL/eVN5JgH91ozHFWU4+bXr8/Fi/8NQk6xRI=";
patches = [
../../patches/flaky-tests.patch
patch-sqlite-exception
patch-monitorfdhup
];
}
12 changes: 12 additions & 0 deletions pkgs/tools/package-management/nix/versions/2.13/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{ common
, patch-fix-aarch64-darwin-static
, ...
}:

common {
version = "2.13.1";
hash = "sha256-uXh4+xjJUHQSCg+LHh6+SSYtMdjKQiTXMZ4uZFwzdq4=";
patches = [
patch-fix-aarch64-darwin-static
];
}
8 changes: 8 additions & 0 deletions pkgs/tools/package-management/nix/versions/2.14/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{ common
, ...
}:

common {
version = "2.14.1";
hash = "sha256-5aCmGZbsFcLIckCDfvnPD4clGPQI7qYAqHYlttN/Wkg=";
}
8 changes: 8 additions & 0 deletions pkgs/tools/package-management/nix/versions/2.15/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{ common
, ...
}:

common {
version = "2.15.1";
hash = "sha256-o7bxsNeq2LF6/dTl+lT2k50bSItkID80/uoZYVtlxro=";
}
8 changes: 8 additions & 0 deletions pkgs/tools/package-management/nix/versions/2.16/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{ common
, ...
}:

common {
version = "2.16.1";
hash = "sha256-/XCWa2osNFIpPC5MkxlX6qTZf/DaTLwS3LWN0SRFiuU=";
}
21 changes: 21 additions & 0 deletions pkgs/tools/package-management/nix/versions/2.3/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{ boehmgc-nix_2_3
, fetchurl
, common
, patch-monitorfdhup
, ...
}:

(common rec {
version = "2.3.16";
src = fetchurl {
url = "https://nixos.org/releases/nix/nix-${version}/nix-${version}.tar.xz";
hash = "sha256-fuaBtp8FtSVJLSAsO+3Nne4ZYLuBj2JpD2xEk7fCqrw=";
};
patches = [
patch-monitorfdhup
];
})
.override {
boehmgc = boehmgc-nix_2_3;
}