mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 01:19:32 +08:00
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 <natto@weirdnatto.in>
This commit is contained in:
@@ -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 [
|
||||
|
||||
Reference in New Issue
Block a user