Merge pull request #98731 from mayflower/ldap-nss-optional

config.users.ldap: do not include nss module if turned off
This commit is contained in:
Linus Heckemann 2020-12-12 10:53:39 +01:00 committed by GitHub
commit f448ec3365
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -238,9 +238,9 @@ in
'';
};
system.nssModules = singleton (
system.nssModules = mkIf cfg.nsswitch (singleton (
if cfg.daemon.enable then nss_pam_ldapd else nss_ldap
);
));
system.nssDatabases.group = optional cfg.nsswitch "ldap";
system.nssDatabases.passwd = optional cfg.nsswitch "ldap";