diff --git a/modules/cluster/deployment-options.nix b/modules/cluster/deployment-options.nix index be567046..4a4afcfb 100644 --- a/modules/cluster/deployment-options.nix +++ b/modules/cluster/deployment-options.nix @@ -1,4 +1,4 @@ -{ lib, ... }: +{ zentralwerk, lib, ... }: # our custom options { options.deployment = with lib; { @@ -12,7 +12,14 @@ }; networks = mkOption { type = with types; listOf str; - default = [ "serv" ]; + default = builtins.attrNames ( + lib.filterAttrs (net: { hosts4, hosts6, ... }: + hosts4 ? ${hostName} || + lib.filterAttrs (ctx: hosts6: + hosts6 ? ${hostName} + ) hosts6 != {} + ) zentralwerk.lib.config.site.net + ); }; persistedShares = mkOption { type = with types; listOf str; diff --git a/modules/cluster/deployment.nix b/modules/cluster/deployment.nix index b6096ea3..c0d2a1cd 100644 --- a/modules/cluster/deployment.nix +++ b/modules/cluster/deployment.nix @@ -8,17 +8,9 @@ let flpk = "flpk-gw"; }; - nets = builtins.attrNames ( - lib.filterAttrs (net: { hosts4, hosts6, ... }: - hosts4 ? ${hostName} || - lib.filterAttrs (ctx: hosts6: - hosts6 ? ${hostName} - ) hosts6 != {} - ) zentralwerk.lib.config.site.net - ); - inherit (config.networking) hostName; inherit (config.system.build.skyflake-deployment) user repo vmName; + inherit (config.deployment) networks; generateMacAddress = net: let @@ -37,8 +29,6 @@ let in { - deployment.networks = nets; - microvm = { hypervisor = "cloud-hypervisor"; vcpu = config.deployment.vcpu; @@ -104,7 +94,7 @@ in # rename interface to net name linkConfig.Name = net; }; - }) {} nets; + }) {} networks; networks = builtins.foldl' (networks: net: networks // { "30-${net}" = @@ -135,6 +125,6 @@ builtins.filter (hosts6: hosts6 ? ${hostName}) ( ) ); }; - }) {} nets; + }) {} networks; }; }