summary refs log tree commit diff
path: root/nixos/modules/services/networking/avahi-daemon.nix
diff options
context:
space:
mode:
authorBenno Fünfstück <benno.fuenfstueck@gmail.com>2016-10-15 22:30:50 +0200
committerBenno Fünfstück <benno.fuenfstueck@gmail.com>2016-10-15 22:51:39 +0200
commit796264a708d85987e0e6a528203ade20462f3f9c (patch)
treec3642680f882ac442fa3fd989e781b489a852197 /nixos/modules/services/networking/avahi-daemon.nix
parentdab4f0a7201d10be8e2aeaddec621536709ba8a2 (diff)
downloadnixpkgs-796264a708d85987e0e6a528203ade20462f3f9c.tar
nixpkgs-796264a708d85987e0e6a528203ade20462f3f9c.tar.gz
nixpkgs-796264a708d85987e0e6a528203ade20462f3f9c.tar.bz2
nixpkgs-796264a708d85987e0e6a528203ade20462f3f9c.tar.lz
nixpkgs-796264a708d85987e0e6a528203ade20462f3f9c.tar.xz
nixpkgs-796264a708d85987e0e6a528203ade20462f3f9c.tar.zst
nixpkgs-796264a708d85987e0e6a528203ade20462f3f9c.zip
nixos/avahi: use more upstream-like systemd units
The new units mirror the upstream systemd units as closely as possible.
I could not find a reason why the service would need to be restarted on
resuming from suspend, and the upstream units also do not contain such a
restriction, so I removed the `partOf = [ "post-resume.target"]`.
This fixes #19525.
Diffstat (limited to 'nixos/modules/services/networking/avahi-daemon.nix')
-rw-r--r--nixos/modules/services/networking/avahi-daemon.nix15
1 files changed, 12 insertions, 3 deletions
diff --git a/nixos/modules/services/networking/avahi-daemon.nix b/nixos/modules/services/networking/avahi-daemon.nix
index ecc091d1d03..6a786e75bbc 100644
--- a/nixos/modules/services/networking/avahi-daemon.nix
+++ b/nixos/modules/services/networking/avahi-daemon.nix
@@ -175,11 +175,20 @@ in
 
     environment.systemPackages = [ pkgs.avahi ];
 
+    systemd.sockets.avahi-daemon =
+      { description = "Avahi mDNS/DNS-SD Stack Activation Socket";
+        listenStreams = [ "/var/run/avahi-daemon/socket" ];
+        wantedBy = [ "sockets.target" ];
+      };
+
     systemd.services.avahi-daemon =
-      { description = "Avahi daemon";
+      { description = "Avahi mDNS/DNS-SD Stack";
         wantedBy = [ "multi-user.target" ];
-        # Receive restart event after resume
-        partOf = [ "post-resume.target" ];
+        requires = [ "avahi-daemon.socket" ];
+
+        serviceConfig."NotifyAccess" = "main";
+        serviceConfig."BusName" = "org.freedesktop.Avahi";
+        serviceConfig."Type" = "dbus";
 
         path = [ pkgs.coreutils pkgs.avahi ];