From 65b188a7cd08cc368e242a00b08750b262cad9c6 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Sun, 8 Dec 2024 16:44:49 +0100 Subject: [PATCH] fix(meta): Use correct optional --- meta/options.nix | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/meta/options.nix b/meta/options.nix index 0bbfd8b..55d18a2 100644 --- a/meta/options.nix +++ b/meta/options.nix @@ -6,7 +6,7 @@ let mkDefault mkIf mkOption - optional + optionalAttrs ; inherit (lib.types) @@ -204,15 +204,18 @@ in }; config = { - deployment = { - tags = [ "infra-${config.site}" ]; - targetHost = optional (builtins.hasAttr name args.config.network) ( - let - ip = with args.config.network.${name}.addresses; ipv4 ++ ipv6; - in - mkIf (ip != [ ]) (mkDefault (builtins.head ip)) - ); - }; + deployment = + { + tags = [ "infra-${config.site}" ]; + } + // (optionalAttrs (builtins.hasAttr name args.config.network) { + targetHost = + let + ip = with args.config.network.${name}.addresses; ipv4 ++ ipv6; + in + mkIf (ip != [ ]) (mkDefault (builtins.head ip)); + + }); }; } )