Merge pull request #161124 from Atemu/nixos/nix-skip-all-checks

nixos/nix-daemon: make checkConfig fully disable nix.conf validation

authored by Linus Heckemann and committed by GitHub 79ec5f2d 6d3aacb2

+22 -5
+8
nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
··· 652 </listitem> 653 <listitem> 654 <para> 655 <literal>generateOptparseApplicativeCompletions</literal> and 656 <literal>generateOptparseApplicativeCompletion</literal> from 657 <literal>haskell.lib.compose</literal> (and
··· 652 </listitem> 653 <listitem> 654 <para> 655 + The <literal>nix.checkConfig</literal> option now fully 656 + disables the config check. The new 657 + <literal>nix.checkAllErrors</literal> option behaves like 658 + <literal>nix.checkConfig</literal> previously did. 659 + </para> 660 + </listitem> 661 + <listitem> 662 + <para> 663 <literal>generateOptparseApplicativeCompletions</literal> and 664 <literal>generateOptparseApplicativeCompletion</literal> from 665 <literal>haskell.lib.compose</literal> (and
+2
nixos/doc/manual/release-notes/rl-2211.section.md
··· 216 217 - virtlyst package and `services.virtlyst` module removed, due to lack of maintainers. 218 219 - `generateOptparseApplicativeCompletions` and `generateOptparseApplicativeCompletion` from `haskell.lib.compose` 220 (and `haskell.lib`) have been deprecated in favor of `generateOptparseApplicativeCompletions` (plural!) as 221 provided by the haskell package sets (so `haskellPackages.generateOptparseApplicativeCompletions` etc.).
··· 216 217 - virtlyst package and `services.virtlyst` module removed, due to lack of maintainers. 218 219 + - The `nix.checkConfig` option now fully disables the config check. The new `nix.checkAllErrors` option behaves like `nix.checkConfig` previously did. 220 + 221 - `generateOptparseApplicativeCompletions` and `generateOptparseApplicativeCompletion` from `haskell.lib.compose` 222 (and `haskell.lib`) have been deprecated in favor of `generateOptparseApplicativeCompletions` (plural!) as 223 provided by the haskell package sets (so `haskellPackages.generateOptparseApplicativeCompletions` etc.).
+12 -5
nixos/modules/services/misc/nix-daemon.nix
··· 59 ${mkKeyValuePairs cfg.settings} 60 ${cfg.extraOptions} 61 ''; 62 - checkPhase = 63 if pkgs.stdenv.hostPlatform != pkgs.stdenv.buildPlatform then '' 64 echo "Ignoring validation for cross-compilation" 65 '' ··· 72 ${cfg.package}/bin/nix show-config ${optionalString (isNixAtLeast "2.3pre") "--no-net"} \ 73 ${optionalString (isNixAtLeast "2.4pre") "--option experimental-features nix-command"} \ 74 |& sed -e 's/^warning:/error:/' \ 75 - | (! grep '${if cfg.checkConfig then "^error:" else "^error: unknown setting"}') 76 set -o pipefail 77 - ''; 78 }; 79 80 legacyConfMappings = { ··· 395 type = types.bool; 396 default = true; 397 description = lib.mdDoc '' 398 - If enabled (the default), checks for data type mismatches and that Nix 399 - can parse the generated nix.conf. 400 ''; 401 }; 402
··· 59 ${mkKeyValuePairs cfg.settings} 60 ${cfg.extraOptions} 61 ''; 62 + checkPhase = lib.optionalString cfg.checkConfig ( 63 if pkgs.stdenv.hostPlatform != pkgs.stdenv.buildPlatform then '' 64 echo "Ignoring validation for cross-compilation" 65 '' ··· 72 ${cfg.package}/bin/nix show-config ${optionalString (isNixAtLeast "2.3pre") "--no-net"} \ 73 ${optionalString (isNixAtLeast "2.4pre") "--option experimental-features nix-command"} \ 74 |& sed -e 's/^warning:/error:/' \ 75 + | (! grep '${if cfg.checkAllErrors then "^error:" else "^error: unknown setting"}') 76 set -o pipefail 77 + ''); 78 }; 79 80 legacyConfMappings = { ··· 395 type = types.bool; 396 default = true; 397 description = lib.mdDoc '' 398 + If enabled, checks that Nix can parse the generated nix.conf. 399 + ''; 400 + }; 401 + 402 + checkAllErrors = mkOption { 403 + type = types.bool; 404 + default = true; 405 + description = lib.mdDoc '' 406 + If enabled, checks the nix.conf parsing for any kind of error. When disabled, checks only for unknown settings. 407 ''; 408 }; 409