diff --git a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
index 8fbe6f7c37b6..99f9a4eb57ed 100644
--- a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
+++ b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
@@ -650,6 +650,14 @@
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
diff --git a/nixos/doc/manual/release-notes/rl-2211.section.md b/nixos/doc/manual/release-notes/rl-2211.section.md
index 2570167e00ac..20c23a0cdd73 100644
--- a/nixos/doc/manual/release-notes/rl-2211.section.md
+++ b/nixos/doc/manual/release-notes/rl-2211.section.md
@@ -216,6 +216,8 @@ Available as [services.patroni](options.html#opt-services.patroni.enable).
- 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.).
diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix
index ba3ea4c47ac1..e8a21c352bdd 100644
--- a/nixos/modules/services/misc/nix-daemon.nix
+++ b/nixos/modules/services/misc/nix-daemon.nix
@@ -59,7 +59,7 @@ let
${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"
''
@@ -72,9 +72,9 @@ let
${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 = {
@@ -395,8 +395,15 @@ in
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.
'';
};