git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #144197 from NixOS/nix-2.4

nix: 2.3.16 -> 2.4

commita6587473294e990bb41fdcefac406432b8a1f15e authorDomen Kožar <domen@dev.si> dateTue 9 Nov 2021, 13:17 (5 years ago) parent6bf50c7ca5ecbe
12 files changed+48−27
lib/tests/modules.sh+12−12 lib/tests/release.nix+4 lib/tests/sources.sh+3−3 nixos/doc/manual/from_md/release-notes/rl-2111.section.xml+9 nixos/doc/manual/release-notes/rl-2111.section.md+2 nixos/modules/installer/tools/nix-fallback-paths.nix+5−5 pkgs/development/haskell-modules/configuration-nix.nix+5−1 pkgs/tools/package-management/nix/default.nix+1−1 pkgs/top-level/aliases.nix+1−1 pkgs/top-level/all-packages.nix+3−3 pkgs/top-level/nixpkgs-basic-release-checks.nix+2−1 pkgs/top-level/python-packages.nix+1
lib/tests/modules.sh+12−12
@@ -62,17 +62,17 @@ checkConfigError() {
6262
6363# Check boolean option.
6464checkConfigOutput "false" config.enable ./declare-enable.nix
65−checkConfigError 'The option .* does not exist. Definition values:\n- In .*: true' config.enable ./define-enable.nix
65+checkConfigError 'The option .* does not exist. Definition values:\n\s*- In .*: true' config.enable ./define-enable.nix
6666
6767# Check integer types.
6868# unsigned
6969checkConfigOutput "42" config.value ./declare-int-unsigned-value.nix ./define-value-int-positive.nix
70−checkConfigError 'A definition for option .* is not of type.*unsigned integer.*. Definition values:\n- In .*: -23' config.value ./declare-int-unsigned-value.nix ./define-value-int-negative.nix
70+checkConfigError 'A definition for option .* is not of type.*unsigned integer.*. Definition values:\n\s*- In .*: -23' config.value ./declare-int-unsigned-value.nix ./define-value-int-negative.nix
7171# positive
72−checkConfigError 'A definition for option .* is not of type.*positive integer.*. Definition values:\n- In .*: 0' config.value ./declare-int-positive-value.nix ./define-value-int-zero.nix
72+checkConfigError 'A definition for option .* is not of type.*positive integer.*. Definition values:\n\s*- In .*: 0' config.value ./declare-int-positive-value.nix ./define-value-int-zero.nix
7373# between
7474checkConfigOutput "42" config.value ./declare-int-between-value.nix ./define-value-int-positive.nix
75−checkConfigError 'A definition for option .* is not of type.*between.*-21 and 43.*inclusive.*. Definition values:\n- In .*: -23' config.value ./declare-int-between-value.nix ./define-value-int-negative.nix
75+checkConfigError 'A definition for option .* is not of type.*between.*-21 and 43.*inclusive.*. Definition values:\n\s*- In .*: -23' config.value ./declare-int-between-value.nix ./define-value-int-negative.nix
7676
7777# Check either types
7878# types.either
@@ -125,7 +125,7 @@ checkConfigOutput 'true' "$@" ./define-enable.nix ./define-attrsOfSub-foo-enable
125125set -- config.enable ./define-enable.nix ./declare-enable.nix
126126checkConfigOutput "true" "$@"
127127checkConfigOutput "false" "$@" ./disable-define-enable.nix
128−checkConfigError "The option .*enable.* does not exist. Definition values:\n- In .*: true" "$@" ./disable-declare-enable.nix
128+checkConfigError "The option .*enable.* does not exist. Definition values:\n\s*- In .*: true" "$@" ./disable-declare-enable.nix
129129checkConfigError "attribute .*enable.* in selection path .*config.enable.* not found" "$@" ./disable-define-enable.nix ./disable-declare-enable.nix
130130checkConfigError "attribute .*enable.* in selection path .*config.enable.* not found" "$@" ./disable-enable-modules.nix
131131
@@ -142,18 +142,18 @@ checkConfigError 'infinite recursion encountered' "$@"
142142
143143# Check _module.check.
144144set -- config.enable ./declare-enable.nix ./define-enable.nix ./define-attrsOfSub-foo.nix
145−checkConfigError 'The option .* does not exist. Definition values:\n- In .*' "$@"
145+checkConfigError 'The option .* does not exist. Definition values:\n\s*- In .*' "$@"
146146checkConfigOutput "true" "$@" ./define-module-check.nix
147147
148148# Check coerced value.
149149checkConfigOutput "\"42\"" config.value ./declare-coerced-value.nix
150150checkConfigOutput "\"24\"" config.value ./declare-coerced-value.nix ./define-value-string.nix
151−checkConfigError 'A definition for option .* is not.*string or signed integer convertible to it.*. Definition values:\n- In .*: \[ \]' config.value ./declare-coerced-value.nix ./define-value-list.nix
151+checkConfigError 'A definition for option .* is not.*string or signed integer convertible to it.*. Definition values:\n\s*- In .*: \[ \]' config.value ./declare-coerced-value.nix ./define-value-list.nix
152152
153153# Check coerced value with unsound coercion
154154checkConfigOutput "12" config.value ./declare-coerced-value-unsound.nix
155−checkConfigError 'A definition for option .* is not of type .*. Definition values:\n- In .*: "1000"' config.value ./declare-coerced-value-unsound.nix ./define-value-string-bigint.nix
156−checkConfigError 'unrecognised JSON value' config.value ./declare-coerced-value-unsound.nix ./define-value-string-arbitrary.nix
155+checkConfigError 'A definition for option .* is not of type .*. Definition values:\n\s*- In .*: "1000"' config.value ./declare-coerced-value-unsound.nix ./define-value-string-bigint.nix
156+checkConfigError 'json.exception.parse_error' config.value ./declare-coerced-value-unsound.nix ./define-value-string-arbitrary.nix
157157
158158# Check mkAliasOptionModule.
159159checkConfigOutput "true" config.enable ./alias-with-priority.nix
@@ -169,7 +169,7 @@ checkConfigOutput "foo" config.submodule.foo ./declare-submoduleWith-special.nix
169169## shorthandOnlyDefines config behaves as expected
170170checkConfigOutput "true" config.submodule.config ./declare-submoduleWith-shorthand.nix ./define-submoduleWith-shorthand.nix
171171checkConfigError 'is not of type `boolean' config.submodule.config ./declare-submoduleWith-shorthand.nix ./define-submoduleWith-noshorthand.nix
172−checkConfigError "You're trying to declare a value of type \`bool'\nrather than an attribute-set for the option" config.submodule.config ./declare-submoduleWith-noshorthand.nix ./define-submoduleWith-shorthand.nix
172+checkConfigError "You're trying to declare a value of type \`bool'\n\s*rather than an attribute-set for the option" config.submodule.config ./declare-submoduleWith-noshorthand.nix ./define-submoduleWith-shorthand.nix
173173checkConfigOutput "true" config.submodule.config ./declare-submoduleWith-noshorthand.nix ./define-submoduleWith-noshorthand.nix
174174
175175## submoduleWith should merge all modules in one swoop
@@ -193,7 +193,7 @@ checkConfigOutput "true" config.submodule.enable ./declare-submoduleWith-path.ni
193193checkConfigOutput "true" config.enable ./disable-recursive/main.nix
194194checkConfigOutput "true" config.enable ./disable-recursive/{main.nix,disable-foo.nix}
195195checkConfigOutput "true" config.enable ./disable-recursive/{main.nix,disable-bar.nix}
196−checkConfigError 'The option .* does not exist. Definition values:\n- In .*: true' config.enable ./disable-recursive/{main.nix,disable-foo.nix,disable-bar.nix}
196+checkConfigError 'The option .* does not exist. Definition values:\n\s*- In .*: true' config.enable ./disable-recursive/{main.nix,disable-foo.nix,disable-bar.nix}
197197
198198# Check that imports can depend on derivations
199199checkConfigOutput "true" config.enable ./import-from-store.nix
@@ -277,7 +277,7 @@ checkConfigOutput baz config.value.nested.bar.baz ./types-anything/mk-mods.nix
277277## types.functionTo
278278checkConfigOutput "input is input" config.result ./functionTo/trivial.nix
279279checkConfigOutput "a b" config.result ./functionTo/merging-list.nix
280−checkConfigError 'A definition for option .fun.\[function body\]. is not of type .string.. Definition values:\n- In .*wrong-type.nix' config.result ./functionTo/wrong-type.nix
280+checkConfigError 'A definition for option .fun.\[function body\]. is not of type .string.. Definition values:\n\s*- In .*wrong-type.nix' config.result ./functionTo/wrong-type.nix
281281checkConfigOutput "b a" config.result ./functionTo/list-order.nix
282282checkConfigOutput "a c" config.result ./functionTo/merging-attrs.nix
283283
lib/tests/release.nix+4
@@ -23,6 +23,10 @@ pkgs.runCommand "nixpkgs-lib-tests" {
2323 export NIX_STORE_DIR=$TEST_ROOT/store
2424 export PAGER=cat
2525 cacheDir=$TEST_ROOT/binary-cache
26+
27+ mkdir -p $NIX_CONF_DIR
28+ echo "experimental-features = nix-command" >> $NIX_CONF_DIR/nix.conf
29+
2630 nix-store --init
2731
2832 cp -r ${../.} lib
lib/tests/sources.sh+3−3
@@ -26,7 +26,7 @@ touch {README.md,module.o,foo.bar}
2626# nix-instantiate doesn't write out the source, only computing the hash, so
2727# this uses the experimental nix command instead.
2828
29−dir="$(nix eval --raw '(with import <nixpkgs/lib>; "${
29+dir="$(nix eval --impure --raw --expr '(with import <nixpkgs/lib>; "${
3030 cleanSource ./.
3131}")')"
3232(cd $dir; find) | sort -f | diff -U10 - <(cat <<EOF
@@ -37,7 +37,7 @@ EOF
3737) || die "cleanSource 1"
3838
3939
40−dir="$(nix eval --raw '(with import <nixpkgs/lib>; "${
40+dir="$(nix eval --impure --raw --expr '(with import <nixpkgs/lib>; "${
4141 cleanSourceWith { src = '"$work"'; filter = path: type: ! hasSuffix ".bar" path; }
4242}")')"
4343(cd $dir; find) | sort -f | diff -U10 - <(cat <<EOF
@@ -47,7 +47,7 @@ dir="$(nix eval --raw '(with import <nixpkgs/lib>; "${
4747EOF
4848) || die "cleanSourceWith 1"
4949
50−dir="$(nix eval --raw '(with import <nixpkgs/lib>; "${
50+dir="$(nix eval --impure --raw --expr '(with import <nixpkgs/lib>; "${
5151 cleanSourceWith { src = cleanSource '"$work"'; filter = path: type: ! hasSuffix ".bar" path; }
5252}")')"
5353(cd $dir; find) | sort -f | diff -U10 - <(cat <<EOF
nixos/doc/manual/from_md/release-notes/rl-2111.section.xml+9
@@ -15,6 +15,15 @@
1515 <section xml:id="sec-release-21.11-highlights">
1616 <title>Highlights</title>
1717 <itemizedlist>
18+ <listitem>
19+ <para>
20+ Nix has been updated to version 2.4, reference its
21+ <link xlink:href="https://discourse.nixos.org/t/nix-2-4-released/15822">release
22+ notes</link> for more information on what has changed. The
23+ previous version of Nix, 2.3.16, remains available for the
24+ time being in the <literal>nix_2_3</literal> package.
25+ </para>
26+ </listitem>
1827 <listitem>
1928 <para>
2029 <literal>iptables</literal> now uses
nixos/doc/manual/release-notes/rl-2111.section.md+2
@@ -6,6 +6,8 @@ In addition to numerous new and upgraded packages, this release has the followin
66
77## Highlights {#sec-release-21.11-highlights}
88
9+- Nix has been updated to version 2.4, reference its [release notes](https://discourse.nixos.org/t/nix-2-4-released/15822) for more information on what has changed. The previous version of Nix, 2.3.16, remains available for the time being in the `nix_2_3` package.
10+
911- `iptables` now uses `nf_tables` backend.
1012
1113- PHP now defaults to PHP 8.0, updated from 7.4.
nixos/modules/installer/tools/nix-fallback-paths.nix+5−5
@@ -1,7 +1,7 @@
11{
2− x86_64-linux = "/nix/store/nzp4m3cmm7wawk031byh8jg4cdzjq212-nix-2.3.16";
3− i686-linux = "/nix/store/zsaza9pwim617ak15fsc31lv65b9w3in-nix-2.3.16";
4− aarch64-linux = "/nix/store/7f6z40gyd405yd50qkyzwilnqw106bx8-nix-2.3.16";
5− x86_64-darwin = "/nix/store/c43kyri67ia8mibs0id5ara7gqwlkybf-nix-2.3.16";
6− aarch64-darwin = "/nix/store/6jwhak3cvsgnbqs540n27g8pxnk427fr-nix-2.3.16";
2+ x86_64-linux = "/nix/store/hapw7q1fkjxvprnkcgw9ppczavg4daj2-nix-2.4";
3+ i686-linux = "/nix/store/8qlvh8pp5j8wgrzj3is2jlbhgrwgsiy9-nix-2.4";
4+ aarch64-linux = "/nix/store/h48lkygcqj4hdibbdnpl67q7ks6vkrd6-nix-2.4";
5+ x86_64-darwin = "/nix/store/c3mvzszvyzakvcp9spnjvsb8m2bpjk7m-nix-2.4";
6+ aarch64-darwin = "/nix/store/hbfqs62r0hga2yr4zi5kc7fzhf71bq9n-nix-2.4";
77}
pkgs/development/haskell-modules/configuration-nix.nix+5−1
@@ -935,7 +935,11 @@ self: super: builtins.intersectAttrs super {
935935
936936 rel8 = addTestToolDepend super.rel8 pkgs.postgresql;
937937
938− cachix = generateOptparseApplicativeCompletion "cachix" super.cachix;
938+ cachix = generateOptparseApplicativeCompletion "cachix" (super.cachix.override { nix = pkgs.nix_2_3; });
939+
940+ hercules-ci-agent = super.hercules-ci-agent.override { nix = pkgs.nix_2_3; };
941+ hercules-ci-cnix-expr = super.hercules-ci-cnix-expr.override { nix = pkgs.nix_2_3; };
942+ hercules-ci-cnix-store = super.hercules-ci-cnix-store.override { nix = pkgs.nix_2_3; };
939943
940944 # Enable extra optimisations which increase build time, but also
941945 # later compiler performance, so we should do this for user's benefit.
pkgs/tools/package-management/nix/default.nix+1−1
@@ -213,7 +213,7 @@ in rec {
213213
214214 nix = nixStable;
215215
216− nixStable = nix_2_3;
216+ nixStable = nix_2_4;
217217
218218 nix_2_3 = callPackage common (rec {
219219 pname = "nix";
pkgs/top-level/aliases.nix+1−1
@@ -590,7 +590,7 @@ mapAliases ({
590590 nginxUnstable = nginxMainline; # added 2018-04-25
591591 nilfs_utils = nilfs-utils; # added 2018-04-25
592592 nix-review = nixpkgs-review; # added 2019-12-22
593− nixFlakes = nix_2_4; # added 2021-05-21
593+ nixFlakes = nixStable; # added 2021-05-21
594594 nmap_graphical = nmap-graphical; # added 2017-01-19
595595 nmap-unfree = nmap; # added 2021-04-06
596596 nologin = shadow; # added 2018-04-25
pkgs/top-level/all-packages.nix+3−3
@@ -18661,7 +18661,7 @@ with pkgs;
1866118661 nghttp2 = callPackage ../development/libraries/nghttp2 { };
1866218662 libnghttp2 = nghttp2.lib;
1866318663
18664− nix-plugins = callPackage ../development/libraries/nix-plugins {};
18664+ nix-plugins = callPackage ../development/libraries/nix-plugins { nix = nix_2_3; };
1866518665
1866618666 nika-fonts = callPackage ../data/fonts/nika-fonts { };
1866718667
@@ -32431,7 +32431,7 @@ with pkgs;
3243132431
3243232432 nix-eval-jobs = callPackage ../tools/package-management/nix-eval-jobs { };
3243332433
32434− nix-doc = callPackage ../tools/package-management/nix-doc { };
32434+ nix-doc = callPackage ../tools/package-management/nix-doc { nix = nix_2_3; };
3243532435
3243632436 nix-bundle = callPackage ../tools/package-management/nix-bundle { };
3243732437
@@ -32453,7 +32453,7 @@ with pkgs;
3245332453
3245432454 nix-linter = haskell.lib.justStaticExecutables (haskellPackages.nix-linter);
3245532455
32456− nixos-option = callPackage ../tools/nix/nixos-option { };
32456+ nixos-option = callPackage ../tools/nix/nixos-option { nix = nix_2_3; };
3245732457
3245832458 nix-pin = callPackage ../tools/package-management/nix-pin { };
3245932459
pkgs/top-level/nixpkgs-basic-release-checks.nix+2−1
@@ -3,7 +3,8 @@
33pkgs.runCommand "nixpkgs-release-checks" { src = nixpkgs; buildInputs = [nix]; } ''
44 set -o pipefail
55
6− export NIX_STATE_DIR=$TMPDIR
6+ export NIX_STORE_DIR=$TMPDIR/store
7+ export NIX_STATE_DIR=$TMPDIR/state
78 export NIX_PATH=nixpkgs=$TMPDIR/barf.nix
89 opts=(--option build-users-group "")
910 nix-store --init
pkgs/top-level/python-packages.nix+1
@@ -7492,6 +7492,7 @@ in {
74927492 };
74937493
74947494 pythonix = callPackage ../development/python-modules/pythonix {
7495+ nix = pkgs.nix_2_3;
74957496 meson = pkgs.meson.override { python3 = self.python; };
74967497 };
74977498