From 7149c5cb604a0a661c27fc2fc8286ddf0efcee46 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Sat, 11 Jun 2022 20:46:48 +0200 Subject: [PATCH] mpd: fix socket activation Apparently since systemd v250 a `ListenStream` in an override file won't override the unit, but will be appended to a list of socket addresses. The socket unit fails if two or more addresses have the same port, probably because two systemd processes try to listen to it at once. The solution is to add an empty `ListenStream=` to reset all previous definitions. Fix #175478. --- nixos/modules/services/audio/mpd.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/services/audio/mpd.nix b/nixos/modules/services/audio/mpd.nix index 586b9ffa688..11733d99fca 100644 --- a/nixos/modules/services/audio/mpd.nix +++ b/nixos/modules/services/audio/mpd.nix @@ -215,6 +215,7 @@ in { systemd.sockets.mpd = mkIf cfg.startWhenNeeded { wantedBy = [ "sockets.target" ]; listenStreams = [ + "" # Note: this is needed to override the upstream unit (if pkgs.lib.hasPrefix "/" cfg.network.listenAddress then cfg.network.listenAddress else "${optionalString (cfg.network.listenAddress != "any") "${cfg.network.listenAddress}:"}${toString cfg.network.port}")