diff --git a/lib/tests/modules.sh b/lib/tests/modules.sh index 49fc8bcbafc4..aba3f08122f5 100755 --- a/lib/tests/modules.sh +++ b/lib/tests/modules.sh @@ -62,17 +62,17 @@ checkConfigError() { # Check boolean option. checkConfigOutput "false" config.enable ./declare-enable.nix -checkConfigError 'The option .* does not exist. Definition values:\n- In .*: true' config.enable ./define-enable.nix +checkConfigError 'The option .* does not exist. Definition values:\n\s*- In .*: true' config.enable ./define-enable.nix # Check integer types. # unsigned checkConfigOutput "42" config.value ./declare-int-unsigned-value.nix ./define-value-int-positive.nix -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 +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 # positive -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 +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 # between checkConfigOutput "42" config.value ./declare-int-between-value.nix ./define-value-int-positive.nix -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 +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 # Check either types # types.either @@ -125,7 +125,7 @@ checkConfigOutput 'true' "$@" ./define-enable.nix ./define-attrsOfSub-foo-enable set -- config.enable ./define-enable.nix ./declare-enable.nix checkConfigOutput "true" "$@" checkConfigOutput "false" "$@" ./disable-define-enable.nix -checkConfigError "The option .*enable.* does not exist. Definition values:\n- In .*: true" "$@" ./disable-declare-enable.nix +checkConfigError "The option .*enable.* does not exist. Definition values:\n\s*- In .*: true" "$@" ./disable-declare-enable.nix checkConfigError "attribute .*enable.* in selection path .*config.enable.* not found" "$@" ./disable-define-enable.nix ./disable-declare-enable.nix checkConfigError "attribute .*enable.* in selection path .*config.enable.* not found" "$@" ./disable-enable-modules.nix @@ -142,18 +142,18 @@ checkConfigError 'infinite recursion encountered' "$@" # Check _module.check. set -- config.enable ./declare-enable.nix ./define-enable.nix ./define-attrsOfSub-foo.nix -checkConfigError 'The option .* does not exist. Definition values:\n- In .*' "$@" +checkConfigError 'The option .* does not exist. Definition values:\n\s*- In .*' "$@" checkConfigOutput "true" "$@" ./define-module-check.nix # Check coerced value. checkConfigOutput "\"42\"" config.value ./declare-coerced-value.nix checkConfigOutput "\"24\"" config.value ./declare-coerced-value.nix ./define-value-string.nix -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 +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 # Check coerced value with unsound coercion checkConfigOutput "12" config.value ./declare-coerced-value-unsound.nix -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 -checkConfigError 'unrecognised JSON value' config.value ./declare-coerced-value-unsound.nix ./define-value-string-arbitrary.nix +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 +checkConfigError 'json.exception.parse_error' config.value ./declare-coerced-value-unsound.nix ./define-value-string-arbitrary.nix # Check mkAliasOptionModule. checkConfigOutput "true" config.enable ./alias-with-priority.nix @@ -169,7 +169,7 @@ checkConfigOutput "foo" config.submodule.foo ./declare-submoduleWith-special.nix ## shorthandOnlyDefines config behaves as expected checkConfigOutput "true" config.submodule.config ./declare-submoduleWith-shorthand.nix ./define-submoduleWith-shorthand.nix checkConfigError 'is not of type `boolean' config.submodule.config ./declare-submoduleWith-shorthand.nix ./define-submoduleWith-noshorthand.nix -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 +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 checkConfigOutput "true" config.submodule.config ./declare-submoduleWith-noshorthand.nix ./define-submoduleWith-noshorthand.nix ## submoduleWith should merge all modules in one swoop @@ -193,7 +193,7 @@ checkConfigOutput "true" config.submodule.enable ./declare-submoduleWith-path.ni checkConfigOutput "true" config.enable ./disable-recursive/main.nix checkConfigOutput "true" config.enable ./disable-recursive/{main.nix,disable-foo.nix} checkConfigOutput "true" config.enable ./disable-recursive/{main.nix,disable-bar.nix} -checkConfigError 'The option .* does not exist. Definition values:\n- In .*: true' config.enable ./disable-recursive/{main.nix,disable-foo.nix,disable-bar.nix} +checkConfigError 'The option .* does not exist. Definition values:\n\s*- In .*: true' config.enable ./disable-recursive/{main.nix,disable-foo.nix,disable-bar.nix} # Check that imports can depend on derivations checkConfigOutput "true" config.enable ./import-from-store.nix @@ -277,7 +277,7 @@ checkConfigOutput baz config.value.nested.bar.baz ./types-anything/mk-mods.nix ## types.functionTo checkConfigOutput "input is input" config.result ./functionTo/trivial.nix checkConfigOutput "a b" config.result ./functionTo/merging-list.nix -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 +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 checkConfigOutput "b a" config.result ./functionTo/list-order.nix checkConfigOutput "a c" config.result ./functionTo/merging-attrs.nix diff --git a/lib/tests/release.nix b/lib/tests/release.nix index 77e0e1af7555..815841e0a8f3 100644 --- a/lib/tests/release.nix +++ b/lib/tests/release.nix @@ -23,6 +23,10 @@ pkgs.runCommand "nixpkgs-lib-tests" { export NIX_STORE_DIR=$TEST_ROOT/store export PAGER=cat cacheDir=$TEST_ROOT/binary-cache + + mkdir -p $NIX_CONF_DIR + echo "experimental-features = nix-command" >> $NIX_CONF_DIR/nix.conf + nix-store --init cp -r ${../.} lib diff --git a/lib/tests/sources.sh b/lib/tests/sources.sh index 71fee719cb21..1f63cac5005a 100755 --- a/lib/tests/sources.sh +++ b/lib/tests/sources.sh @@ -26,7 +26,7 @@ touch {README.md,module.o,foo.bar} # nix-instantiate doesn't write out the source, only computing the hash, so # this uses the experimental nix command instead. -dir="$(nix eval --raw '(with import ; "${ +dir="$(nix eval --impure --raw --expr '(with import ; "${ cleanSource ./. }")')" (cd $dir; find) | sort -f | diff -U10 - <(cat < Highlights + + + Nix has been updated to version 2.4, reference its + release + notes 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. + + iptables now uses diff --git a/nixos/doc/manual/release-notes/rl-2111.section.md b/nixos/doc/manual/release-notes/rl-2111.section.md index 1c737542e7d2..d957cf4ac0e0 100644 --- a/nixos/doc/manual/release-notes/rl-2111.section.md +++ b/nixos/doc/manual/release-notes/rl-2111.section.md @@ -6,6 +6,8 @@ In addition to numerous new and upgraded packages, this release has the followin ## Highlights {#sec-release-21.11-highlights} +- 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. + - `iptables` now uses `nf_tables` backend. - PHP now defaults to PHP 8.0, updated from 7.4. diff --git a/nixos/modules/installer/tools/nix-fallback-paths.nix b/nixos/modules/installer/tools/nix-fallback-paths.nix index cb509b7340bd..065cea470fbb 100644 --- a/nixos/modules/installer/tools/nix-fallback-paths.nix +++ b/nixos/modules/installer/tools/nix-fallback-paths.nix @@ -1,7 +1,7 @@ { - x86_64-linux = "/nix/store/nzp4m3cmm7wawk031byh8jg4cdzjq212-nix-2.3.16"; - i686-linux = "/nix/store/zsaza9pwim617ak15fsc31lv65b9w3in-nix-2.3.16"; - aarch64-linux = "/nix/store/7f6z40gyd405yd50qkyzwilnqw106bx8-nix-2.3.16"; - x86_64-darwin = "/nix/store/c43kyri67ia8mibs0id5ara7gqwlkybf-nix-2.3.16"; - aarch64-darwin = "/nix/store/6jwhak3cvsgnbqs540n27g8pxnk427fr-nix-2.3.16"; + x86_64-linux = "/nix/store/hapw7q1fkjxvprnkcgw9ppczavg4daj2-nix-2.4"; + i686-linux = "/nix/store/8qlvh8pp5j8wgrzj3is2jlbhgrwgsiy9-nix-2.4"; + aarch64-linux = "/nix/store/h48lkygcqj4hdibbdnpl67q7ks6vkrd6-nix-2.4"; + x86_64-darwin = "/nix/store/c3mvzszvyzakvcp9spnjvsb8m2bpjk7m-nix-2.4"; + aarch64-darwin = "/nix/store/hbfqs62r0hga2yr4zi5kc7fzhf71bq9n-nix-2.4"; } diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index 5fc968ccddeb..1418a8d6fe82 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -935,7 +935,11 @@ self: super: builtins.intersectAttrs super { rel8 = addTestToolDepend super.rel8 pkgs.postgresql; - cachix = generateOptparseApplicativeCompletion "cachix" super.cachix; + cachix = generateOptparseApplicativeCompletion "cachix" (super.cachix.override { nix = pkgs.nix_2_3; }); + + hercules-ci-agent = super.hercules-ci-agent.override { nix = pkgs.nix_2_3; }; + hercules-ci-cnix-expr = super.hercules-ci-cnix-expr.override { nix = pkgs.nix_2_3; }; + hercules-ci-cnix-store = super.hercules-ci-cnix-store.override { nix = pkgs.nix_2_3; }; # Enable extra optimisations which increase build time, but also # later compiler performance, so we should do this for user's benefit. diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index 7df444177c5e..277ea30e202d 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -213,7 +213,7 @@ in rec { nix = nixStable; - nixStable = nix_2_3; + nixStable = nix_2_4; nix_2_3 = callPackage common (rec { pname = "nix"; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index a320f6a29a29..399d424c59c0 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -590,7 +590,7 @@ mapAliases ({ nginxUnstable = nginxMainline; # added 2018-04-25 nilfs_utils = nilfs-utils; # added 2018-04-25 nix-review = nixpkgs-review; # added 2019-12-22 - nixFlakes = nix_2_4; # added 2021-05-21 + nixFlakes = nixStable; # added 2021-05-21 nmap_graphical = nmap-graphical; # added 2017-01-19 nmap-unfree = nmap; # added 2021-04-06 nologin = shadow; # added 2018-04-25 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 035c937afc88..e2a6f1fa42ee 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18661,7 +18661,7 @@ with pkgs; nghttp2 = callPackage ../development/libraries/nghttp2 { }; libnghttp2 = nghttp2.lib; - nix-plugins = callPackage ../development/libraries/nix-plugins {}; + nix-plugins = callPackage ../development/libraries/nix-plugins { nix = nix_2_3; }; nika-fonts = callPackage ../data/fonts/nika-fonts { }; @@ -32431,7 +32431,7 @@ with pkgs; nix-eval-jobs = callPackage ../tools/package-management/nix-eval-jobs { }; - nix-doc = callPackage ../tools/package-management/nix-doc { }; + nix-doc = callPackage ../tools/package-management/nix-doc { nix = nix_2_3; }; nix-bundle = callPackage ../tools/package-management/nix-bundle { }; @@ -32453,7 +32453,7 @@ with pkgs; nix-linter = haskell.lib.justStaticExecutables (haskellPackages.nix-linter); - nixos-option = callPackage ../tools/nix/nixos-option { }; + nixos-option = callPackage ../tools/nix/nixos-option { nix = nix_2_3; }; nix-pin = callPackage ../tools/package-management/nix-pin { }; diff --git a/pkgs/top-level/nixpkgs-basic-release-checks.nix b/pkgs/top-level/nixpkgs-basic-release-checks.nix index 777cce7e5e0c..350dd273fe2e 100644 --- a/pkgs/top-level/nixpkgs-basic-release-checks.nix +++ b/pkgs/top-level/nixpkgs-basic-release-checks.nix @@ -3,7 +3,8 @@ pkgs.runCommand "nixpkgs-release-checks" { src = nixpkgs; buildInputs = [nix]; } '' set -o pipefail - export NIX_STATE_DIR=$TMPDIR + export NIX_STORE_DIR=$TMPDIR/store + export NIX_STATE_DIR=$TMPDIR/state export NIX_PATH=nixpkgs=$TMPDIR/barf.nix opts=(--option build-users-group "") nix-store --init diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e38e93e1dc1d..b2cb8b9f631e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7492,6 +7492,7 @@ in { }; pythonix = callPackage ../development/python-modules/pythonix { + nix = pkgs.nix_2_3; meson = pkgs.meson.override { python3 = self.python; }; };