Merge pull request #144197 from NixOS/nix-2.4

nix: 2.3.16 -> 2.4

authored by

Domen Kožar and committed by
GitHub
a6587473 6bf50c7f

+48 -27
+12 -12
lib/tests/modules.sh
··· 62 62 63 63 # Check boolean option. 64 64 checkConfigOutput "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 66 66 67 67 # Check integer types. 68 68 # unsigned 69 69 checkConfigOutput "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 71 71 # 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 73 73 # between 74 74 checkConfigOutput "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 76 76 77 77 # Check either types 78 78 # types.either ··· 125 125 set -- config.enable ./define-enable.nix ./declare-enable.nix 126 126 checkConfigOutput "true" "$@" 127 127 checkConfigOutput "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 129 129 checkConfigError "attribute .*enable.* in selection path .*config.enable.* not found" "$@" ./disable-define-enable.nix ./disable-declare-enable.nix 130 130 checkConfigError "attribute .*enable.* in selection path .*config.enable.* not found" "$@" ./disable-enable-modules.nix 131 131 ··· 142 142 143 143 # Check _module.check. 144 144 set -- 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 .*' "$@" 146 146 checkConfigOutput "true" "$@" ./define-module-check.nix 147 147 148 148 # Check coerced value. 149 149 checkConfigOutput "\"42\"" config.value ./declare-coerced-value.nix 150 150 checkConfigOutput "\"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 152 152 153 153 # Check coerced value with unsound coercion 154 154 checkConfigOutput "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 157 157 158 158 # Check mkAliasOptionModule. 159 159 checkConfigOutput "true" config.enable ./alias-with-priority.nix ··· 169 169 ## shorthandOnlyDefines config behaves as expected 170 170 checkConfigOutput "true" config.submodule.config ./declare-submoduleWith-shorthand.nix ./define-submoduleWith-shorthand.nix 171 171 checkConfigError '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 173 173 checkConfigOutput "true" config.submodule.config ./declare-submoduleWith-noshorthand.nix ./define-submoduleWith-noshorthand.nix 174 174 175 175 ## submoduleWith should merge all modules in one swoop ··· 193 193 checkConfigOutput "true" config.enable ./disable-recursive/main.nix 194 194 checkConfigOutput "true" config.enable ./disable-recursive/{main.nix,disable-foo.nix} 195 195 checkConfigOutput "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} 197 197 198 198 # Check that imports can depend on derivations 199 199 checkConfigOutput "true" config.enable ./import-from-store.nix ··· 277 277 ## types.functionTo 278 278 checkConfigOutput "input is input" config.result ./functionTo/trivial.nix 279 279 checkConfigOutput "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 281 281 checkConfigOutput "b a" config.result ./functionTo/list-order.nix 282 282 checkConfigOutput "a c" config.result ./functionTo/merging-attrs.nix 283 283
+4
lib/tests/release.nix
··· 23 23 export NIX_STORE_DIR=$TEST_ROOT/store 24 24 export PAGER=cat 25 25 cacheDir=$TEST_ROOT/binary-cache 26 + 27 + mkdir -p $NIX_CONF_DIR 28 + echo "experimental-features = nix-command" >> $NIX_CONF_DIR/nix.conf 29 + 26 30 nix-store --init 27 31 28 32 cp -r ${../.} lib
+3 -3
lib/tests/sources.sh
··· 26 26 # nix-instantiate doesn't write out the source, only computing the hash, so 27 27 # this uses the experimental nix command instead. 28 28 29 - dir="$(nix eval --raw '(with import <nixpkgs/lib>; "${ 29 + dir="$(nix eval --impure --raw --expr '(with import <nixpkgs/lib>; "${ 30 30 cleanSource ./. 31 31 }")')" 32 32 (cd $dir; find) | sort -f | diff -U10 - <(cat <<EOF ··· 37 37 ) || die "cleanSource 1" 38 38 39 39 40 - dir="$(nix eval --raw '(with import <nixpkgs/lib>; "${ 40 + dir="$(nix eval --impure --raw --expr '(with import <nixpkgs/lib>; "${ 41 41 cleanSourceWith { src = '"$work"'; filter = path: type: ! hasSuffix ".bar" path; } 42 42 }")')" 43 43 (cd $dir; find) | sort -f | diff -U10 - <(cat <<EOF ··· 47 47 EOF 48 48 ) || die "cleanSourceWith 1" 49 49 50 - dir="$(nix eval --raw '(with import <nixpkgs/lib>; "${ 50 + dir="$(nix eval --impure --raw --expr '(with import <nixpkgs/lib>; "${ 51 51 cleanSourceWith { src = cleanSource '"$work"'; filter = path: type: ! hasSuffix ".bar" path; } 52 52 }")')" 53 53 (cd $dir; find) | sort -f | diff -U10 - <(cat <<EOF
+9
nixos/doc/manual/from_md/release-notes/rl-2111.section.xml
··· 17 17 <itemizedlist> 18 18 <listitem> 19 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> 27 + <listitem> 28 + <para> 20 29 <literal>iptables</literal> now uses 21 30 <literal>nf_tables</literal> backend. 22 31 </para>
+2
nixos/doc/manual/release-notes/rl-2111.section.md
··· 6 6 7 7 ## Highlights {#sec-release-21.11-highlights} 8 8 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 + 9 11 - `iptables` now uses `nf_tables` backend. 10 12 11 13 - PHP now defaults to PHP 8.0, updated from 7.4.
+5 -5
nixos/modules/installer/tools/nix-fallback-paths.nix
··· 1 1 { 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"; 7 7 }
+5 -1
pkgs/development/haskell-modules/configuration-nix.nix
··· 935 935 936 936 rel8 = addTestToolDepend super.rel8 pkgs.postgresql; 937 937 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; }; 939 943 940 944 # Enable extra optimisations which increase build time, but also 941 945 # later compiler performance, so we should do this for user's benefit.
+1 -1
pkgs/tools/package-management/nix/default.nix
··· 213 213 214 214 nix = nixStable; 215 215 216 - nixStable = nix_2_3; 216 + nixStable = nix_2_4; 217 217 218 218 nix_2_3 = callPackage common (rec { 219 219 pname = "nix";
+1 -1
pkgs/top-level/aliases.nix
··· 590 590 nginxUnstable = nginxMainline; # added 2018-04-25 591 591 nilfs_utils = nilfs-utils; # added 2018-04-25 592 592 nix-review = nixpkgs-review; # added 2019-12-22 593 - nixFlakes = nix_2_4; # added 2021-05-21 593 + nixFlakes = nixStable; # added 2021-05-21 594 594 nmap_graphical = nmap-graphical; # added 2017-01-19 595 595 nmap-unfree = nmap; # added 2021-04-06 596 596 nologin = shadow; # added 2018-04-25
+3 -3
pkgs/top-level/all-packages.nix
··· 18661 18661 nghttp2 = callPackage ../development/libraries/nghttp2 { }; 18662 18662 libnghttp2 = nghttp2.lib; 18663 18663 18664 - nix-plugins = callPackage ../development/libraries/nix-plugins {}; 18664 + nix-plugins = callPackage ../development/libraries/nix-plugins { nix = nix_2_3; }; 18665 18665 18666 18666 nika-fonts = callPackage ../data/fonts/nika-fonts { }; 18667 18667 ··· 32431 32431 32432 32432 nix-eval-jobs = callPackage ../tools/package-management/nix-eval-jobs { }; 32433 32433 32434 - nix-doc = callPackage ../tools/package-management/nix-doc { }; 32434 + nix-doc = callPackage ../tools/package-management/nix-doc { nix = nix_2_3; }; 32435 32435 32436 32436 nix-bundle = callPackage ../tools/package-management/nix-bundle { }; 32437 32437 ··· 32453 32453 32454 32454 nix-linter = haskell.lib.justStaticExecutables (haskellPackages.nix-linter); 32455 32455 32456 - nixos-option = callPackage ../tools/nix/nixos-option { }; 32456 + nixos-option = callPackage ../tools/nix/nixos-option { nix = nix_2_3; }; 32457 32457 32458 32458 nix-pin = callPackage ../tools/package-management/nix-pin { }; 32459 32459
+2 -1
pkgs/top-level/nixpkgs-basic-release-checks.nix
··· 3 3 pkgs.runCommand "nixpkgs-release-checks" { src = nixpkgs; buildInputs = [nix]; } '' 4 4 set -o pipefail 5 5 6 - export NIX_STATE_DIR=$TMPDIR 6 + export NIX_STORE_DIR=$TMPDIR/store 7 + export NIX_STATE_DIR=$TMPDIR/state 7 8 export NIX_PATH=nixpkgs=$TMPDIR/barf.nix 8 9 opts=(--option build-users-group "") 9 10 nix-store --init
+1
pkgs/top-level/python-packages.nix
··· 7492 7492 }; 7493 7493 7494 7494 pythonix = callPackage ../development/python-modules/pythonix { 7495 + nix = pkgs.nix_2_3; 7495 7496 meson = pkgs.meson.override { python3 = self.python; }; 7496 7497 }; 7497 7498