From a045ccb7995146491251212eaf95bfdb79cc78c4 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Tue, 16 Dec 2025 10:19:34 +0200 Subject: [PATCH] nixos/mpd: don't raise openFirewall warning for bind_to_address sockets --- nixos/modules/services/audio/mpd.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/nixos/modules/services/audio/mpd.nix b/nixos/modules/services/audio/mpd.nix index 1557769b6219..d21dcdac9b03 100644 --- a/nixos/modules/services/audio/mpd.nix +++ b/nixos/modules/services/audio/mpd.nix @@ -371,10 +371,13 @@ in warnings = lib.optional ( - !(builtins.elem cfg.settings.bind_to_address [ - "localhost" - "127.0.0.1" - ]) + !( + (builtins.elem cfg.settings.bind_to_address [ + "localhost" + "127.0.0.1" + ]) + || (lib.hasPrefix "/" cfg.settings.bind_to_address) + ) && !cfg.openFirewall ) "Using '${cfg.settings.bind_to_address}' as services.mpd.settings.bind_to_address without enabling services.mpd.openFirewall, might prevent you from accessing MPD from other clients.";