Merge pull request #279433 from wentasah/nsswitch-mdns

nixos/avahi-daemon: let nssmdns{4,6} options affect also non-minimal …
This commit is contained in:
Florian Klink 2024-01-11 13:21:24 +02:00 committed by GitHub
commit 3d1fe1445c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -273,17 +273,17 @@ in
system.nssModules = optional (cfg.nssmdns4 || cfg.nssmdns6) pkgs.nssmdns;
system.nssDatabases.hosts = let
mdnsMinimal = if (cfg.nssmdns4 && cfg.nssmdns6) then
"mdns_minimal"
mdns = if (cfg.nssmdns4 && cfg.nssmdns6) then
"mdns"
else if (!cfg.nssmdns4 && cfg.nssmdns6) then
"mdns6_minimal"
"mdns6"
else if (cfg.nssmdns4 && !cfg.nssmdns6) then
"mdns4_minimal"
"mdns4"
else
"";
in optionals (cfg.nssmdns4 || cfg.nssmdns6) (mkMerge [
(mkBefore [ "${mdnsMinimal} [NOTFOUND=return]" ]) # before resolve
(mkAfter [ "mdns" ]) # after dns
(mkBefore [ "${mdns}_minimal [NOTFOUND=return]" ]) # before resolve
(mkAfter [ "${mdns}" ]) # after dns
]);
environment.systemPackages = [ cfg.package ];