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

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

Changed files
+22 -5
nixos
doc
manual
from_md
release-notes
release-notes
modules
services
+8
nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
···
</listitem>
<listitem>
<para>
+
The <literal>nix.checkConfig</literal> option now fully
+
disables the config check. The new
+
<literal>nix.checkAllErrors</literal> option behaves like
+
<literal>nix.checkConfig</literal> previously did.
+
</para>
+
</listitem>
+
<listitem>
+
<para>
<literal>generateOptparseApplicativeCompletions</literal> and
<literal>generateOptparseApplicativeCompletion</literal> from
<literal>haskell.lib.compose</literal> (and
+2
nixos/doc/manual/release-notes/rl-2211.section.md
···
- virtlyst package and `services.virtlyst` module removed, due to lack of maintainers.
+
- The `nix.checkConfig` option now fully disables the config check. The new `nix.checkAllErrors` option behaves like `nix.checkConfig` previously did.
+
- `generateOptparseApplicativeCompletions` and `generateOptparseApplicativeCompletion` from `haskell.lib.compose`
(and `haskell.lib`) have been deprecated in favor of `generateOptparseApplicativeCompletions` (plural!) as
provided by the haskell package sets (so `haskellPackages.generateOptparseApplicativeCompletions` etc.).
+12 -5
nixos/modules/services/misc/nix-daemon.nix
···
${mkKeyValuePairs cfg.settings}
${cfg.extraOptions}
'';
-
checkPhase =
+
checkPhase = lib.optionalString cfg.checkConfig (
if pkgs.stdenv.hostPlatform != pkgs.stdenv.buildPlatform then ''
echo "Ignoring validation for cross-compilation"
''
···
${cfg.package}/bin/nix show-config ${optionalString (isNixAtLeast "2.3pre") "--no-net"} \
${optionalString (isNixAtLeast "2.4pre") "--option experimental-features nix-command"} \
|& sed -e 's/^warning:/error:/' \
-
| (! grep '${if cfg.checkConfig then "^error:" else "^error: unknown setting"}')
+
| (! grep '${if cfg.checkAllErrors then "^error:" else "^error: unknown setting"}')
set -o pipefail
-
'';
+
'');
};
legacyConfMappings = {
···
type = types.bool;
default = true;
description = lib.mdDoc ''
-
If enabled (the default), checks for data type mismatches and that Nix
-
can parse the generated nix.conf.
+
If enabled, checks that Nix can parse the generated nix.conf.
+
'';
+
};
+
+
checkAllErrors = mkOption {
+
type = types.bool;
+
default = true;
+
description = lib.mdDoc ''
+
If enabled, checks the nix.conf parsing for any kind of error. When disabled, checks only for unknown settings.
'';
};