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: 2.18 -> 2.24 #335342

Merged
merged 8 commits into from
Sep 17, 2024
Merged
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
8 changes: 8 additions & 0 deletions nixos/doc/manual/release-notes/rl-2411.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
Starting with release 25.05, the minimum supported version will be macOS Big Sur 11, and we cannot guarantee that packages will continue to work on older versions of macOS.
Users on old macOS versions should consider upgrading to a supported version (potentially using [OpenCore Legacy Patcher](https://dortania.github.io/OpenCore-Legacy-Patcher/) for old hardware) or installing NixOS.
If neither of those options are viable and you require new versions of software, [MacPorts](https://www.macports.org/) supports back to Mac OS X Snow Leopard 10.6.
- Nix was updated to 2.24, which brings a lot of improvements and fixes. See the release notes for
[2.19](https://nix.dev/manual/nix/latest/release-notes/rl-2.19),
[2.20](https://nix.dev/manual/nix/latest/release-notes/rl-2.20),
[2.21](https://nix.dev/manual/nix/latest/release-notes/rl-2.21),
[2.22](https://nix.dev/manual/nix/latest/release-notes/rl-2.22),
[2.23](https://nix.dev/manual/nix/latest/release-notes/rl-2.23),
[2.24](https://nix.dev/manual/nix/latest/release-notes/rl-2.24).
Notable changes include improvements to Git fetching, documentation comment support in `nix-repl> :doc`, as well as many quality of life improvements.

- Convenience options for `amdgpu`, open source driver for Radeon cards, is now available under `hardware.amdgpu`.

Expand Down
11 changes: 6 additions & 5 deletions nixos/modules/installer/tools/nix-fallback-paths.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
x86_64-linux = "/nix/store/f409bhlpp0xkzvdz95qr2yvfjfi8r9jc-nix-2.18.5";
i686-linux = "/nix/store/ra39jzrxq3bcpf55aahwv5037akvylf5-nix-2.18.5";
aarch64-linux = "/nix/store/xiw8a4jbnw18svgdb04hyqzg5bsjspqf-nix-2.18.5";
x86_64-darwin = "/nix/store/k2gzx7i90x3h2c8g6xdi1jkwbl6ic895-nix-2.18.5";
aarch64-darwin = "/nix/store/rqwymbndaqxma6p8s5brcl9k32n5xx54-nix-2.18.5";
x86_64-linux = "/nix/store/fmfy9zigxns8f1wfb4v2arf1jmfdjpjc-nix-2.24.6";
i686-linux = "/nix/store/bl95c09pcihf2fdqpzjyjk4bdq0bsizm-nix-2.24.6";
aarch64-linux = "/nix/store/2sbzgmvas19iq3nhg8xbnd8k0khahk34-nix-2.24.6";
riscv64-linux = "/nix/store/7yy1x9sx83wm77mjawd953d6a6wb669q-nix-riscv64-unknown-linux-gnu-2.24.6";
x86_64-darwin = "/nix/store/vs6bbxkwxqr828q8rj1xlbmsbnx1ry6z-nix-2.24.6";
aarch64-darwin = "/nix/store/d88r5b1qv1fvz2j9qndz8sr31mqgz45x-nix-2.24.6";
}
9 changes: 6 additions & 3 deletions pkgs/development/libraries/nix-plugins/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@

stdenv.mkDerivation rec {
pname = "nix-plugins";
version = "14.0.0";
version = "15.0.0";

src = fetchFromGitHub {
owner = "shlevy";
repo = "nix-plugins";
rev = version;
hash = "sha256-RDKAuLwcZ3Pbn5JUDmGBcfD0xbM6Jud2ouXh/YKpfS8=";
hash = "sha256-C4VqKHi6nVAHuXVhqvTRRyn0Bb619ez4LzgUWPH1cbM=";
};

nativeBuildInputs = [ cmake pkg-config ];

buildInputs = [ nix boost ];
buildInputs = [
nix
boost
];

meta = {
description = "Collection of miscellaneous plugins for the nix expression language";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/tools/package-management/nix-doc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
, nix
, pkg-config
# Whether to build the nix-doc plugin for Nix
, withPlugin ? true
, withPlugin ? false # no longer needed for nix 2.24
}:

let
Expand Down
10 changes: 10 additions & 0 deletions pkgs/tools/package-management/nix/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ in

# passthru tests
, pkgsi686Linux
, pkgsStatic
, runCommand
, pkgs
}: let
self = stdenv.mkDerivation {
pname = "nix";
Expand Down Expand Up @@ -259,6 +261,8 @@ self = stdenv.mkDerivation {

tests = {
nixi686 = pkgsi686Linux.nixVersions.${self_attribute_name};
nixStatic = pkgsStatic.nixVersions.${self_attribute_name};

# Basic smoke test that needs to pass when upgrading nix.
# Note that this test does only test the nixVersions.stable attribute.
misc = nixosTests.nix-misc.default;
Expand All @@ -278,6 +282,12 @@ self = stdenv.mkDerivation {
fi
touch $out
'';

/** Intended to test `lib`, but also a good smoke test for Nix */
nixpkgs-lib = import ../../../../lib/tests/test-with-nix.nix {
Copy link
Member

Choose a reason for hiding this comment

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

Is there a method for calling this test without referring to files outside nix/ dirtree, à la RFC 140?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not really a package so RFC 140 "doesn't apply", but something would be nice, I agree.
Currently this file documents that it's not entirely private. Something more formal or even machine-checkable would be nice, but I don't think we have a protocol for this yet.
Not an exact match, but maybe something in this direction?:

inherit lib pkgs;
nix = self;
};
Comment on lines +286 to +290
Copy link
Contributor

Choose a reason for hiding this comment

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

See also this:

testWithNix = nix:
import ./test-with-nix.nix { inherit lib nix pkgs; };
in
pkgs.symlinkJoin {
name = "nixpkgs-lib-tests";
paths = map testWithNix nixVersions ++

I like that you can now test Nix with Nix against every Nix.

};
};

Expand Down
6 changes: 4 additions & 2 deletions pkgs/tools/package-management/nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ let
runCommand "test-nix-fallback-paths-version-equals-nix-stable" {
paths = lib.concatStringsSep "\n" (builtins.attrValues (import ../../../../nixos/modules/installer/tools/nix-fallback-paths.nix));
} ''
if [[ "" != $(grep -v 'nix-${pkg.version}$' <<< "$paths") ]]; then
# NOTE: name may contain cross compilation details between the pname
# and version this is permitted thanks to ([^-]*-)*
if [[ "" != $(grep -vE 'nix-([^-]*-)*${lib.strings.replaceStrings ["."] ["\\."] pkg.version}$' <<< "$paths") ]]; then
Comment on lines +118 to +120
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment is a bit helpful, but it would be better to extract a few locals here. This combination of Nix, Bash, and regular expressions is quite the stew.

echo "nix-fallback-paths not up to date with nixVersions.stable (nix-${pkg.version})"
echo "The following paths are not up to date:"
grep -v 'nix-${pkg.version}$' <<< "$paths"
Expand Down Expand Up @@ -239,7 +241,7 @@ in lib.makeExtensible (self: ({
else
nix;

stable = addFallbackPathsCheck self.nix_2_18;
stable = addFallbackPathsCheck self.nix_2_24;
} // lib.optionalAttrs config.allowAliases (
lib.listToAttrs (map (
minor:
Expand Down
Loading