fix(meta): Use correct optional
This commit is contained in:
parent
715201abc2
commit
65b188a7cd
1 changed files with 13 additions and 10 deletions
|
@ -6,7 +6,7 @@ let
|
||||||
mkDefault
|
mkDefault
|
||||||
mkIf
|
mkIf
|
||||||
mkOption
|
mkOption
|
||||||
optional
|
optionalAttrs
|
||||||
;
|
;
|
||||||
|
|
||||||
inherit (lib.types)
|
inherit (lib.types)
|
||||||
|
@ -204,15 +204,18 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
deployment = {
|
deployment =
|
||||||
tags = [ "infra-${config.site}" ];
|
{
|
||||||
targetHost = optional (builtins.hasAttr name args.config.network) (
|
tags = [ "infra-${config.site}" ];
|
||||||
let
|
}
|
||||||
ip = with args.config.network.${name}.addresses; ipv4 ++ ipv6;
|
// (optionalAttrs (builtins.hasAttr name args.config.network) {
|
||||||
in
|
targetHost =
|
||||||
mkIf (ip != [ ]) (mkDefault (builtins.head ip))
|
let
|
||||||
);
|
ip = with args.config.network.${name}.addresses; ipv4 ++ ipv6;
|
||||||
};
|
in
|
||||||
|
mkIf (ip != [ ]) (mkDefault (builtins.head ip));
|
||||||
|
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue