Skip to content

Commit a86d069

Browse files
authored
nix: update fallback paths automatically (#353621)
2 parents 5e33351 + fbd1888 commit a86d069

File tree

4 files changed

+27
-6
lines changed

4 files changed

+27
-6
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
x86_64-linux = "/nix/store/2nhrwv91g6ycpyxvhmvc0xs8p92wp4bk-nix-2.24.9";
3-
i686-linux = "/nix/store/idaxj9ji6ggpn1h47a35mf0c8ns4ma39-nix-2.24.9";
4-
aarch64-linux = "/nix/store/7b5q44l2p70bf6m6dprr8f0587ypwq1z-nix-2.24.9";
5-
riscv64-linux = "/nix/store/mgw3il1qk59750g5hbf02km79rgyx00y-nix-riscv64-unknown-linux-gnu-2.24.9";
6-
x86_64-darwin = "/nix/store/rp8rc0pfgham7d7spj5s9syzb138dmmd-nix-2.24.9";
7-
aarch64-darwin = "/nix/store/1n95r340s7p3vdwqh7m94q0a42crahqq-nix-2.24.9";
2+
x86_64-linux = "/nix/store/hdy82qidsybc3fg561pqfwagv44vschb-nix-2.24.10";
3+
i686-linux = "/nix/store/dyx4p79q6blva585bf90wbjjb7iyq8ra-nix-2.24.10";
4+
aarch64-linux = "/nix/store/30gnc15nig1awa11vii9yz3z8518rnr3-nix-2.24.10";
5+
riscv64-linux = "/nix/store/bxc2pyp1vj8kr77khyx5nglw73jqb98w-nix-riscv64-unknown-linux-gnu-2.24.10";
6+
x86_64-darwin = "/nix/store/6mrkghigrci6dz2lnncqpgf80yi8gl7h-nix-2.24.10";
7+
aarch64-darwin = "/nix/store/3f81gjiv836rjmsb29zab0pbjwf9did8-nix-2.24.10";
88
}

pkgs/tools/package-management/nix/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,9 @@ curl https://releases.nixos.org/nix/nix-$version/fallback-paths.nix > nixos/modu
3333
If you're updating `nixVersions.stable`, follow all the steps mentioned above, but use the **staging** branch for your pull request (or **staging-next** after coordinating with the people in matrix `#staging:nixos.org`)
3434
This is necessary because, at the end of the staging-next cycle, the NixOS tests are built through the [staging-next-small](https://hydra.nixos.org/jobset/nixos/staging-next-small) jobset.
3535
Especially nixos installer test are important to look at here.
36+
37+
There is a script to update minor versions:
38+
39+
```
40+
./pkgs/tools/package-management/nix/update-all.sh
41+
```

pkgs/tools/package-management/nix/common.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ let
1616
atLeast210 = lib.versionAtLeast version "2.10pre";
1717
atLeast213 = lib.versionAtLeast version "2.13pre";
1818
atLeast214 = lib.versionAtLeast version "2.14pre";
19+
atLeast218 = lib.versionAtLeast version "2.18pre";
1920
atLeast219 = lib.versionAtLeast version "2.19pre";
2021
atLeast220 = lib.versionAtLeast version "2.20pre";
2122
atLeast221 = lib.versionAtLeast version "2.21pre";
@@ -42,6 +43,7 @@ in
4243
, callPackage
4344
, coreutils
4445
, curl
46+
, darwin
4547
, docbook_xsl_ns
4648
, docbook5
4749
, editline
@@ -158,6 +160,8 @@ self = stdenv.mkDerivation {
158160
libseccomp
159161
] ++ lib.optionals withAWS [
160162
aws-sdk-cpp
163+
] ++ lib.optional (atLeast218 && stdenv.hostPlatform.isDarwin) [
164+
darwin.apple_sdk.libs.sandbox
161165
];
162166

163167

pkgs/tools/package-management/nix/update-all.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,22 @@ NIXPKGS_DIR=$(readlink -f "$SCRIPT_DIR/../../../..")
88
cd "$NIXPKGS_DIR"
99

1010
nix_versions=$(nix eval --impure --json --expr "with import ./. { config.allowAliases = false; }; builtins.filter (name: builtins.match \"nix_.*\" name != null) (builtins.attrNames nixVersions)" | jq -r '.[]')
11+
stable_version_full=$(nix eval --impure --json --expr "with import ./. { config.allowAliases = false; }; nixVersions.stable.version" | jq -r)
12+
13+
# strip patch version
14+
stable_version_trimmed=${stable_version_full%.*}
15+
1116
for name in $nix_versions; do
1217
minor_version=${name#nix_*_}
1318
if [[ "$name" = "nix_2_3" ]]; then # not maintained by the nix team
1419
continue
1520
fi
21+
if [[ "$name" = "nix_${stable_version_trimmed//./_}" ]]; then
22+
curl https://releases.nixos.org/nix/nix-$stable_version_full/fallback-paths.nix > "$NIXPKGS_DIR/nixos/modules/installer/tools/nix-fallback-paths.nix"
23+
# nix-update will commit the file if it has changed
24+
git add "$NIXPKGS_DIR/nixos/modules/installer/tools/nix-fallback-paths.nix"
25+
fi
26+
1627
nix-update --override-filename "$SCRIPT_DIR/default.nix" --version-regex "(2\\.${minor_version}\..+)" --build --commit "nixVersions.$name"
1728
done
1829

0 commit comments

Comments
 (0)