summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2020-05-06 00:17:05 +0200
committerFlorian Klink <flokli@flokli.de>2020-05-11 16:14:50 +0200
commitfd21793de61bacf8893d7c5f6e7fdd3c76855dfe (patch)
tree0d78deebd62998fbfac9e915117c29936d36ff4d
parent4f9c8ef7911d5fdf125b6959244f18270e8e0a19 (diff)
downloadnixpkgs-fd21793de61bacf8893d7c5f6e7fdd3c76855dfe.tar
nixpkgs-fd21793de61bacf8893d7c5f6e7fdd3c76855dfe.tar.gz
nixpkgs-fd21793de61bacf8893d7c5f6e7fdd3c76855dfe.tar.bz2
nixpkgs-fd21793de61bacf8893d7c5f6e7fdd3c76855dfe.tar.lz
nixpkgs-fd21793de61bacf8893d7c5f6e7fdd3c76855dfe.tar.xz
nixpkgs-fd21793de61bacf8893d7c5f6e7fdd3c76855dfe.tar.zst
nixpkgs-fd21793de61bacf8893d7c5f6e7fdd3c76855dfe.zip
nixos/avahi: move nss database configuration into avahi module
-rw-r--r--nixos/modules/config/nsswitch.nix3
-rw-r--r--nixos/modules/services/networking/avahi-daemon.nix4
2 files changed, 4 insertions, 3 deletions
diff --git a/nixos/modules/config/nsswitch.nix b/nixos/modules/config/nsswitch.nix
index 465c910d95b..556ae3951f7 100644
--- a/nixos/modules/config/nsswitch.nix
+++ b/nixos/modules/config/nsswitch.nix
@@ -9,15 +9,12 @@ let
   # only with nscd up and running we can load NSS modules that are not integrated in NSS
   canLoadExternalModules = config.services.nscd.enable;
   # XXX Move these to their respective modules
-  nssmdns = canLoadExternalModules && config.services.avahi.nssmdns;
   nsswins = canLoadExternalModules && config.services.samba.nsswins;
 
   hostArray = mkMerge [
     (mkBefore [ "files" ])
-    (mkIf nssmdns [ "mdns_minimal [NOTFOUND=return]" ])
     (mkIf nsswins [ "wins" ])
     (mkAfter [ "dns" ])
-    (mkIf nssmdns (mkOrder 1501 [ "mdns" ])) # 1501 to ensure it's after dns
   ];
 
 in {
diff --git a/nixos/modules/services/networking/avahi-daemon.nix b/nixos/modules/services/networking/avahi-daemon.nix
index ddcfe3d77e2..c876b252e8c 100644
--- a/nixos/modules/services/networking/avahi-daemon.nix
+++ b/nixos/modules/services/networking/avahi-daemon.nix
@@ -238,6 +238,10 @@ in
     users.groups.avahi = {};
 
     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 ];