mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 14:10:33 +03:00
nixos/avahi-daemon: let nssmdns{4,6} options affect also non-minimal mdns source
This is a followup to commit bba808dbfa
("nixos/avahi-daemon:
resolve mdns only over enabled protocols, disable ipv6 by default",
2023-10-01, PR #258424). mdns occurs twice in /etc/nsswitch.conf but
that commit changed only the first one (mdns_minimal, before resolve).
This commits ensures that both occurrences are set consistently.
This is not only consistent with upstream example[1] but it also
fixes #118628 -- a longstanding issue with CUPS and printer detection.
[1] https://github.com/avahi/nss-mdns#activation
This commit is contained in:
parent
bd645e8668
commit
e23da86b18
1 changed files with 6 additions and 6 deletions
|
@ -274,17 +274,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 ];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue