diff --git a/infra/.modules/hetzner-nixos/main.tf b/infra/.modules/hetzner-nixos/main.tf index acb7d98..14db72e 100644 --- a/infra/.modules/hetzner-nixos/main.tf +++ b/infra/.modules/hetzner-nixos/main.tf @@ -24,8 +24,8 @@ module "nixos" { for_each = hcloud_server.nodes source = "github.com/nix-community/nixos-anywhere//terraform/all-in-one" - nixos_system_attr = "${var.flake}#nixosConfigurations.master.config.system.build.toplevel" - nixos_partitioner_attr = "${var.flake}#nixosConfigurations.master.config.system.build.diskoScript" + nixos_system_attr = "${var.nixos.flake}#nixosConfigurations.${var.nixos.host}.config.system.build.toplevel" + nixos_partitioner_attr = "${var.nixos.flake}#nixosConfigurations.${var.nixos.host}.config.system.build.diskoScript" target_host = each.value.ipv6_address instance_id = each.value.name build_on_remote = true diff --git a/infra/.modules/hetzner-nixos/variables.tf b/infra/.modules/hetzner-nixos/variables.tf index 478afd7..7ad64eb 100644 --- a/infra/.modules/hetzner-nixos/variables.tf +++ b/infra/.modules/hetzner-nixos/variables.tf @@ -4,6 +4,9 @@ variable "nodes" { })) } -variable "flake" { - +variable "nixos" { + type = object({ + flake = string + host = string + }) } diff --git a/infra/production/hetzner/helsinki/compute/.terraform.lock.hcl b/infra/production/hetzner/compute/.terraform.lock.hcl similarity index 100% rename from infra/production/hetzner/helsinki/compute/.terraform.lock.hcl rename to infra/production/hetzner/compute/.terraform.lock.hcl diff --git a/infra/production/hetzner/helsinki/compute/terragrunt.hcl b/infra/production/hetzner/compute/terragrunt.hcl similarity index 76% rename from infra/production/hetzner/helsinki/compute/terragrunt.hcl rename to infra/production/hetzner/compute/terragrunt.hcl index 1801028..5435a25 100644 --- a/infra/production/hetzner/helsinki/compute/terragrunt.hcl +++ b/infra/production/hetzner/compute/terragrunt.hcl @@ -17,5 +17,8 @@ inputs = { # location = "fsn1" # } } - flake = get_terragrunt_dir() + nixos = { + flake = "${find_in_parent_folders(".modules")}/nixos" + host = "k3s" + } }