From 5610ff5ba1cb55ccbf07b377e992614f8ae21a1d Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Sat, 3 Apr 2021 10:54:48 +0200 Subject: [PATCH] Improved error message on disabling NSS modules when disabling nscd Move the hint from a comment to the error message, and provide a clearer example of how to achieve it. --- nixos/modules/config/nsswitch.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/nixos/modules/config/nsswitch.nix b/nixos/modules/config/nsswitch.nix index d19d35a48906..52e343bbf1ca 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. + ''; } ];