From a630bbdedd2997b90e8fee3550134b091879c2cf Mon Sep 17 00:00:00 2001 From: Amneesh Date: Thu, 8 Jan 2026 11:21:16 +0530 Subject: [PATCH] mpd: fix incorrect use of mkIf (#8504) Currently, if cfg.network.listenAddress is set to "any", MPD_HOST causes partial evaluation which fails the sanity check while trying to build a home-manager generation. Hence make a separate attrset for MPD_HOST which will be evaluated conditionally and then concatenated. Signed-off-by: Amneesh Singh --- modules/services/mpd.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/services/mpd.nix b/modules/services/mpd.nix index 3bc20d981..31c581560 100644 --- a/modules/services/mpd.nix +++ b/modules/services/mpd.nix @@ -166,10 +166,14 @@ in mkIf cfg.enable { home = { packages = [ cfg.package ]; - sessionVariables = mkIf cfg.enableSessionVariables { - MPD_HOST = mkIf (cfg.network.listenAddress != "any") cfg.network.listenAddress; - MPD_PORT = builtins.toString cfg.network.port; - }; + sessionVariables = mkIf cfg.enableSessionVariables ( + { + MPD_PORT = builtins.toString cfg.network.port; + } + // lib.optionalAttrs (cfg.network.listenAddress != "any") { + MPD_HOST = cfg.network.listenAddress; + } + ); }; services.mpd = lib.mkMerge [