From 7a2e940a3f92e451018af2f4736308f00d084b73 Mon Sep 17 00:00:00 2001 From: Daniel Albert Date: Sat, 7 Mar 2020 19:34:04 +0100 Subject: [PATCH] nixos/mpd: allow autostart when listening for unix socket --- nixos/modules/services/audio/mpd.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/audio/mpd.nix b/nixos/modules/services/audio/mpd.nix index e20591b5beb4..8110c18d40ed 100644 --- a/nixos/modules/services/audio/mpd.nix +++ b/nixos/modules/services/audio/mpd.nix @@ -148,7 +148,9 @@ in { description = "Music Player Daemon Socket"; wantedBy = [ "sockets.target" ]; listenStreams = [ - "${optionalString (cfg.network.listenAddress != "any") "${cfg.network.listenAddress}:"}${toString cfg.network.port}" + (if pkgs.lib.hasPrefix "/" cfg.network.listenAddress + then cfg.network.listenAddress + else "${optionalString (cfg.network.listenAddress != "any") "${cfg.network.listenAddress}:"}${toString cfg.network.port}") ]; socketConfig = { Backlog = 5;