mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 09:29:41 +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 {
|
mkIf cfg.enable {
|
||||||
home = {
|
home = {
|
||||||
packages = [ cfg.package ];
|
packages = [ cfg.package ];
|
||||||
sessionVariables = mkIf cfg.enableSessionVariables {
|
sessionVariables = mkIf cfg.enableSessionVariables (
|
||||||
MPD_HOST = mkIf (cfg.network.listenAddress != "any") cfg.network.listenAddress;
|
{
|
||||||
MPD_PORT = builtins.toString cfg.network.port;
|
MPD_PORT = builtins.toString cfg.network.port;
|
||||||
};
|
}
|
||||||
|
// lib.optionalAttrs (cfg.network.listenAddress != "any") {
|
||||||
|
MPD_HOST = cfg.network.listenAddress;
|
||||||
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
services.mpd = lib.mkMerge [
|
services.mpd = lib.mkMerge [
|
||||||
|
|||||||
Reference in New Issue
Block a user