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:
parent
86e0f6f227
commit
a630bbdedd
1 changed files with 8 additions and 4 deletions
|
|
@ -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 [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue