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.
This commit is contained in:
Arnout Engelen 2021-04-03 10:54:48 +02:00
parent 04a2b269d8
commit 5610ff5ba1
No known key found for this signature in database
GPG Key ID: 061107B0F74A6DAA

View File

@ -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.
'';
}
];