Skip to content
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
1 change: 0 additions & 1 deletion pkgs/tools/package-management/nix/2_26/.version

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this PR editing nix/2_26 instead of introducing a new nix/2_27?

@griffi-gh griffi-gh Feb 25, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is why its a draft, which ill probably end up re-doing in a different way

(the difference between the two versions is minor (a single extra dependency and obviously a different source) so wasn't sure about duplicating the entire tree)

This file was deleted.

9 changes: 5 additions & 4 deletions pkgs/tools/package-management/nix/2_26/componentized.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
src,
baseVersion,
officialRelease,

lib,
fetchFromGitHub,
splicePackages,
Expand All @@ -9,9 +13,6 @@
...
}:
let
officialRelease = true;
src = fetchFromGitHub (builtins.fromJSON (builtins.readFile ./source.json));

# A new scope, so that we can use `callPackage` to inject our own interdependencies
# without "polluting" the top level "`pkgs`" attrset.
# This also has the benefit of providing us with a distinct set of packages
Expand All @@ -25,7 +26,7 @@ let
{
otherSplices = generateSplicesForMkScope "nixComponents";
f = import ./packaging/components.nix {
inherit lib officialRelease src;
inherit lib officialRelease src baseVersion;
};
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
lib,
src,
baseVersion,
officialRelease,
}:

Expand All @@ -9,8 +10,6 @@ scope:
let
inherit (scope) callPackage;

baseVersion = lib.fileContents ../.version;

versionSuffix = lib.optionalString (!officialRelease) "pre";

fineVersionSuffix =
Expand Down
6 changes: 0 additions & 6 deletions pkgs/tools/package-management/nix/2_26/source.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
nlohmann_json,
openssl,

# for 2.27+
libblake3,

# Configuration Options

version,
Expand Down Expand Up @@ -44,7 +47,8 @@ mkMesonLibrary (finalAttrs: {
brotli
libsodium
openssl
] ++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid;
] ++ (lib.optional stdenv.hostPlatform.isx86_64 libcpuid)
++ (lib.optional (lib.versionAtLeast version "2.27") libblake3);

propagatedBuildInputs = [
boost
Expand Down
44 changes: 27 additions & 17 deletions pkgs/tools/package-management/nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,19 @@ let
aws-sdk-cpp = if lib.versionAtLeast args.version "2.12pre" then aws-sdk-cpp-nix else aws-sdk-cpp-old-nix;
};

common_2_26 = args: ((callPackage ./2_26/componentized.nix args).overrideAttrs (this: old: {
passthru = old.passthru or {} // {
tests =
old.passthru.tests or {}
// import ./tests.nix {
inherit runCommand lib stdenv pkgs pkgsi686Linux pkgsStatic nixosTests;
inherit (old) version src;
nix = this.finalPackage;
self_attribute_name = "nix_2_26";
};
};
}));

# https://github.com/NixOS/nix/pull/7585
patch-monitorfdhup = fetchpatch2 {
name = "nix-7585-monitor-fd-hup.patch";
Expand Down Expand Up @@ -164,29 +177,26 @@ in lib.makeExtensible (self: ({
self_attribute_name = "nix_2_25";
};

nix_2_26 = (callPackage ./2_26/componentized.nix { }).overrideAttrs (this: old: {
passthru = old.passthru or {} // {
tests =
old.passthru.tests or {}
// import ./tests.nix {
inherit runCommand lib stdenv pkgs pkgsi686Linux pkgsStatic nixosTests;
inherit (old) version src;
nix = this.finalPackage;
self_attribute_name = "nix_2_26";
};
nix_2_26 = common_2_26 {
baseVersion = "2.26.1";
officialRelease = true;
src = fetchFromGitHub {
owner = "NixOS";
repo = "nix";
rev = "36bd92736faaf81c6af3dff8f560963eb4e76b14";
hash = "sha256-1T7WRNfUMsiiNB77BuHElzjavguL8oJx+wBtfMcobq8=";
};
});
};

git = common rec {
version = "2.25.0";
suffix = "pre20241101_${lib.substring 0 8 src.rev}";
git = common_2_26 {
baseVersion = "2.27.0";
officialRelease = false;
src = fetchFromGitHub {
owner = "NixOS";
repo = "nix";
rev = "2e5759e3778c460efc5f7cfc4cb0b84827b5ffbe";
hash = "sha256-E1Sp0JHtbD1CaGO3UbBH6QajCtOGqcrVfPSKL0n63yo=";
rev = "e5fdb4b164958202a9913f163f9f9242f03120c1";
hash = "sha256-oBC57hHNaLYPpzoatU6gM77nHFLLOlBXHh2xUqdLh+Y=";
};
self_attribute_name = "git";
};

latest = self.nix_2_25;
Expand Down