forked from mirrors/nixpkgs
nixos/avahi: move nss database configuration into avahi module
This commit is contained in:
parent
4f9c8ef791
commit
fd21793de6
|
@ -9,15 +9,12 @@ let
|
||||||
# only with nscd up and running we can load NSS modules that are not integrated in NSS
|
# only with nscd up and running we can load NSS modules that are not integrated in NSS
|
||||||
canLoadExternalModules = config.services.nscd.enable;
|
canLoadExternalModules = config.services.nscd.enable;
|
||||||
# XXX Move these to their respective modules
|
# XXX Move these to their respective modules
|
||||||
nssmdns = canLoadExternalModules && config.services.avahi.nssmdns;
|
|
||||||
nsswins = canLoadExternalModules && config.services.samba.nsswins;
|
nsswins = canLoadExternalModules && config.services.samba.nsswins;
|
||||||
|
|
||||||
hostArray = mkMerge [
|
hostArray = mkMerge [
|
||||||
(mkBefore [ "files" ])
|
(mkBefore [ "files" ])
|
||||||
(mkIf nssmdns [ "mdns_minimal [NOTFOUND=return]" ])
|
|
||||||
(mkIf nsswins [ "wins" ])
|
(mkIf nsswins [ "wins" ])
|
||||||
(mkAfter [ "dns" ])
|
(mkAfter [ "dns" ])
|
||||||
(mkIf nssmdns (mkOrder 1501 [ "mdns" ])) # 1501 to ensure it's after dns
|
|
||||||
];
|
];
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
|
@ -238,6 +238,10 @@ in
|
||||||
users.groups.avahi = {};
|
users.groups.avahi = {};
|
||||||
|
|
||||||
system.nssModules = optional cfg.nssmdns pkgs.nssmdns;
|
system.nssModules = optional cfg.nssmdns pkgs.nssmdns;
|
||||||
|
system.nssDatabases.hosts = optionals cfg.nssmdns (mkMerge [
|
||||||
|
[ "mdns_minimal [NOTFOUND=return]" ]
|
||||||
|
(mkOrder 1501 [ "mdns" ]) # 1501 to ensure it's after dns
|
||||||
|
]);
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.avahi ];
|
environment.systemPackages = [ pkgs.avahi ];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue