about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2022-04-16 22:55:40 +0200
committerGitHub <noreply@github.com>2022-04-16 22:55:40 +0200
commit6df0dae4f9a0a96369e89913fa6e6845f54c8f0f (patch)
tree2eb2e679d6110daf1961cfc6faffb78b47e0ad65
parent5cd04131c97d6131162b474ec8121454c9994d5f (diff)
parent5610ff5ba1cb55ccbf07b377e992614f8ae21a1d (diff)
Merge pull request #118387 from raboof/document-how-to-disable-nss
Improved error message on disabling NSS modules when disabling nscd
-rw-r--r--nixos/modules/config/nsswitch.nix11
1 files changed, 7 insertions, 4 deletions
diff --git a/nixos/modules/config/nsswitch.nix b/nixos/modules/config/nsswitch.nix
index 91a36cef10e67..e494ff5f74d5a 100644
--- a/nixos/modules/config/nsswitch.nix
+++ b/nixos/modules/config/nsswitch.nix
@@ -95,11 +95,14 @@ with lib;
   config = {
     assertions = [
       {
-        # Prevent users from disabling nscd, with nssModules being set.
-        # If disabling nscd is really necessary, it's still possible to opt out
-        # by forcing config.system.nssModules to [].
         assertion = config.system.nssModules.path != "" -> config.services.nscd.enable;
-        message = "Loading NSS modules from system.nssModules (${config.system.nssModules.path}), requires services.nscd.enable being set to true.";
+        message = ''
+          Loading NSS modules from system.nssModules (${config.system.nssModules.path}),
+          requires services.nscd.enable being set to true.
+
+          If disabling nscd is really necessary, it is possible to disable loading NSS modules
+          by setting `system.nssModules = lib.mkForce [];` in your configuration.nix.
+        '';
       }
     ];