fix(meta): Use correct optional

This commit is contained in:
Tom Hubrecht 2024-12-08 16:44:49 +01:00
parent 715201abc2
commit 65b188a7cd
Signed by: thubrecht
SSH key fingerprint: SHA256:r+nK/SIcWlJ0zFZJGHtlAoRwq1Rm+WcKAm5ADYMoQPc

View file

@ -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}" ]; tags = [ "infra-${config.site}" ];
targetHost = optional (builtins.hasAttr name args.config.network) ( }
// (optionalAttrs (builtins.hasAttr name args.config.network) {
targetHost =
let let
ip = with args.config.network.${name}.addresses; ipv4 ++ ipv6; ip = with args.config.network.${name}.addresses; ipv4 ++ ipv6;
in in
mkIf (ip != [ ]) (mkDefault (builtins.head ip)) mkIf (ip != [ ]) (mkDefault (builtins.head ip));
);
}; });
}; };
} }
) )