From f4376377d41b1704b0ef3dd7ae88804b22f869ed Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Sun, 24 Aug 2025 11:18:59 +0700 Subject: [PATCH] refactor(infra): move NixOS modules to the right dir --- .../hetzner-nixos}/main.tf | 0 .../hetzner-nixos}/outputs.tf | 0 .../hetzner-nixos}/variables.tf | 0 .../hetzner-nixos}/versions.tf | 0 infra/.modules/nixos/Makefile | 19 --- infra/.modules/nixos/configuration.nix | 123 ++++-------------- infra/{ => .modules}/nixos/disks.nix | 0 infra/.modules/nixos/flake.lock | 19 ++- infra/.modules/nixos/flake.nix | 28 ++-- infra/{ => .modules}/nixos/profiles/k3s.nix | 0 infra/.modules/nixos/test.nix | 15 --- .../proxmox-nixos}/main.tf | 0 .../proxmox-nixos}/terraform.tf | 0 .../proxmox-nixos}/variables.tf | 0 infra/local/bootstrap/terragrunt.hcl | 2 +- infra/local/cluster/terragrunt.hcl | 2 +- infra/nixos/configuration.nix | 67 ---------- infra/nixos/flake.lock | 47 ------- infra/nixos/flake.nix | 39 ------ .../compute/hetzner-vm/configuration.nix | 118 ----------------- .../helsinki/compute/hetzner-vm/flake.lock | 48 ------- .../helsinki/compute/hetzner-vm/flake.nix | 21 --- .../hetzner/helsinki/compute/terragrunt.hcl | 3 +- .../oracle/bootstrap/terragrunt.hcl | 2 +- .../production/oracle/cluster/terragrunt.hcl | 2 +- infra/production/oracle/legacy/terragrunt.hcl | 2 +- .../production/oracle/secrets/terragrunt.hcl | 2 +- .../compute/.terraform.lock.hcl | 22 ---- .../vn-southwest-1/compute/terragrunt.hcl | 4 +- infra/production/tfstate/.terraform.lock.hcl | 25 ---- infra/production/tfstate/terragrunt.hcl | 2 +- 31 files changed, 59 insertions(+), 553 deletions(-) rename infra/{production/hetzner/helsinki/compute/hetzner-vm => .modules/hetzner-nixos}/main.tf (100%) rename infra/{production/hetzner/helsinki/compute/hetzner-vm => .modules/hetzner-nixos}/outputs.tf (100%) rename infra/{production/hetzner/helsinki/compute/hetzner-vm => .modules/hetzner-nixos}/variables.tf (100%) rename infra/{production/hetzner/helsinki/compute/hetzner-vm => .modules/hetzner-nixos}/versions.tf (100%) delete mode 100644 infra/.modules/nixos/Makefile rename infra/{ => .modules}/nixos/disks.nix (100%) rename infra/{ => .modules}/nixos/profiles/k3s.nix (100%) delete mode 100644 infra/.modules/nixos/test.nix rename infra/{production/proxmox/vn-southwest-1/compute/nixos-vm => .modules/proxmox-nixos}/main.tf (100%) rename infra/{production/proxmox/vn-southwest-1/compute/nixos-vm => .modules/proxmox-nixos}/terraform.tf (100%) rename infra/{production/proxmox/vn-southwest-1/compute/nixos-vm => .modules/proxmox-nixos}/variables.tf (100%) delete mode 100644 infra/nixos/configuration.nix delete mode 100644 infra/nixos/flake.lock delete mode 100644 infra/nixos/flake.nix delete mode 100644 infra/production/hetzner/helsinki/compute/hetzner-vm/configuration.nix delete mode 100644 infra/production/hetzner/helsinki/compute/hetzner-vm/flake.lock delete mode 100644 infra/production/hetzner/helsinki/compute/hetzner-vm/flake.nix delete mode 100644 infra/production/tfstate/.terraform.lock.hcl diff --git a/infra/production/hetzner/helsinki/compute/hetzner-vm/main.tf b/infra/.modules/hetzner-nixos/main.tf similarity index 100% rename from infra/production/hetzner/helsinki/compute/hetzner-vm/main.tf rename to infra/.modules/hetzner-nixos/main.tf diff --git a/infra/production/hetzner/helsinki/compute/hetzner-vm/outputs.tf b/infra/.modules/hetzner-nixos/outputs.tf similarity index 100% rename from infra/production/hetzner/helsinki/compute/hetzner-vm/outputs.tf rename to infra/.modules/hetzner-nixos/outputs.tf diff --git a/infra/production/hetzner/helsinki/compute/hetzner-vm/variables.tf b/infra/.modules/hetzner-nixos/variables.tf similarity index 100% rename from infra/production/hetzner/helsinki/compute/hetzner-vm/variables.tf rename to infra/.modules/hetzner-nixos/variables.tf diff --git a/infra/production/hetzner/helsinki/compute/hetzner-vm/versions.tf b/infra/.modules/hetzner-nixos/versions.tf similarity index 100% rename from infra/production/hetzner/helsinki/compute/hetzner-vm/versions.tf rename to infra/.modules/hetzner-nixos/versions.tf diff --git a/infra/.modules/nixos/Makefile b/infra/.modules/nixos/Makefile deleted file mode 100644 index 423021d..0000000 --- a/infra/.modules/nixos/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -.POSIX: - -.PHONY: * -default: switch - -switch: - sudo nixos-rebuild \ - --flake '.#netamos' \ - --impure \ - switch - -update: - nix flake update - -test: - @nix \ - --experimental-features 'nix-command flakes' \ - run \ - '.#nixosConfigurations.test.config.system.build.vmWithDisko' diff --git a/infra/.modules/nixos/configuration.nix b/infra/.modules/nixos/configuration.nix index d1aaad6..eacdbd5 100644 --- a/infra/.modules/nixos/configuration.nix +++ b/infra/.modules/nixos/configuration.nix @@ -1,40 +1,9 @@ -{ config, pkgs, ... }: +{ modulesPath, ... }: { - disko.devices = { - disk = { - main = { - type = "disk"; - content = { - type = "gpt"; - partitions = { - boot = { - size = "1M"; - type = "EF02"; # for grub MBR - }; - ESP = { - size = "1G"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ "umask=0077" ]; - }; - }; - root = { - size = "100%"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - }; - }; - }; - }; - }; - }; + imports = [ + (modulesPath + "/profiles/all-hardware.nix") + ]; boot = { loader = { @@ -51,21 +20,8 @@ networkmanager = { enable = true; }; - firewall = { - # https://docs.k3s.io/installation/requirements#inbound-rules-for-k3s-server-nodes - allowedTCPPorts = [ - 6443 - 10250 - ]; - allowedTCPPortRanges = [ - { from = 2379; to = 2380; } - ]; - }; }; - time.timeZone = "Asia/Ho_Chi_Minh"; - i18n.defaultLocale = "en_US.UTF-8"; - nix = { settings = { experimental-features = [ @@ -82,65 +38,30 @@ }; services = { - openssh.enable = true; - k3s = { + openssh = { enable = true; - role = "server"; - extraFlags = toString [ - "--disable-helm-controller" - "--disable-network-policy" - "--disable=traefik" - "--secrets-encryption=true" - - # TODO not sure why it doesn't play nice with the registry config below - # "--snapshotter=stargz" - - # TODO if the node doesn't have IPv6, this will fail, so we can't enable by default yet - # "--cluster-cidr=10.42.0.0/16,2001:cafe:42::/56" - # "--service-cidr=10.43.0.0/16,2001:cafe:43::/112" - ]; }; - yggdrasil = { + qemuGuest = { enable = true; - persistentKeys = true; - settings = { - Peers = [ - # https://publicpeers.neilalexander.dev - "tls://sin.yuetau.net:6643" # Singapore - "tls://mima.localghost.org:443" # Philippines - "tls://133.18.201.69:54232" # Japan - "tls://vpn.itrus.su:7992" # Netherlands - "tls://ygg.jjolly.dev:3443" # United States - ]; - }; }; }; - # TODO switch to services.k3s.registries https://github.com/NixOS/nixpkgs/pull/292023 - # Static ClusterIP so we can pull from the internal registry without going through an ingress for better performance - # Alternatively this can be done by resolving DNS on the node via CoreDNS in some way, maybe via /etc/resolv.conf? - # nix-shell -p dig --command "dig @10.43.0.10 zot.zot.svc.cluster.local" - environment.etc."rancher/k3s/registries.yaml".text = '' - mirrors: - zot.zot.svc.cluster.local: - endpoint: - - http://10.43.0.50:5000 - ''; - - users.users.admin = { - isNormalUser = true; - description = "Admin"; - extraGroups = [ - "networkmanager" - "wheel" - ]; - packages = with pkgs; [ - neovim - git - gnumake - tmux - ]; + users.users = { + admin = { + isNormalUser = true; + extraGroups = [ + "wheel" + ]; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN5ue4np7cF34f6dwqH1262fPjkowHQ8irfjVC156PCG" + ]; + }; + root = { + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN5ue4np7cF34f6dwqH1262fPjkowHQ8irfjVC156PCG" + ]; + }; }; - system.stateVersion = "23.11"; + system.stateVersion = "24.11"; } diff --git a/infra/nixos/disks.nix b/infra/.modules/nixos/disks.nix similarity index 100% rename from infra/nixos/disks.nix rename to infra/.modules/nixos/disks.nix diff --git a/infra/.modules/nixos/flake.lock b/infra/.modules/nixos/flake.lock index d95826f..35c7766 100644 --- a/infra/.modules/nixos/flake.lock +++ b/infra/.modules/nixos/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1731274291, - "narHash": "sha256-cZ0QMpv5p2a6WEE+o9uu0a4ma6RzQDOQTbm7PbixWz8=", + "lastModified": 1737038063, + "narHash": "sha256-rMEuiK69MDhjz1JgbaeQ9mBDXMJ2/P8vmOYRbFndXsk=", "owner": "nix-community", "repo": "disko", - "rev": "486250f404f4a4f4f33f8f669d83ca5f6e6b7dfc", + "rev": "bf0abfde48f469c256f2b0f481c6281ff04a5db2", "type": "github" }, "original": { @@ -22,18 +22,17 @@ }, "nixpkgs": { "locked": { - "lastModified": 1731239293, - "narHash": "sha256-q2yjIWFFcTzp5REWQUOU9L6kHdCDmFDpqeix86SOvDc=", + "lastModified": 1737672001, + "narHash": "sha256-YnHJJ19wqmibLQdUeq9xzE6CjrMA568KN/lFPuSVs4I=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9256f7c71a195ebe7a218043d9f93390d49e6884", + "rev": "035f8c0853c2977b24ffc4d0a42c74f00b182cd8", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" + "id": "nixpkgs", + "ref": "nixos-24.11", + "type": "indirect" } }, "root": { diff --git a/infra/.modules/nixos/flake.nix b/infra/.modules/nixos/flake.nix index dc9ec3f..36ffb41 100644 --- a/infra/.modules/nixos/flake.nix +++ b/infra/.modules/nixos/flake.nix @@ -1,29 +1,37 @@ { - description = "Netamos"; - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; + nixpkgs.url = "nixpkgs/nixos-24.11"; disko = { url = "github:nix-community/disko"; inputs.nixpkgs.follows = "nixpkgs"; }; }; - - outputs = { self, nixpkgs, disko }: { + outputs = { nixpkgs, disko, ... }: { nixosConfigurations = { - netamos = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; # TODO support multiple systems + nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; modules = [ disko.nixosModules.disko ./configuration.nix + ./disks.nix ]; }; - test = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; # TODO support multiple systems + devbox = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; modules = [ disko.nixosModules.disko ./configuration.nix - ./test.nix + ./disks.nix + ./profiles/devbox.nix + ]; + }; + k3s = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + disko.nixosModules.disko + ./configuration.nix + ./disks.nix + ./profiles/k3s.nix ]; }; }; diff --git a/infra/nixos/profiles/k3s.nix b/infra/.modules/nixos/profiles/k3s.nix similarity index 100% rename from infra/nixos/profiles/k3s.nix rename to infra/.modules/nixos/profiles/k3s.nix diff --git a/infra/.modules/nixos/test.nix b/infra/.modules/nixos/test.nix deleted file mode 100644 index 7458784..0000000 --- a/infra/.modules/nixos/test.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ modulesPath, ... }: - -{ - imports = [ - (modulesPath + "/virtualisation/qemu-vm.nix") - ]; - - disko.devices.disk.main.device = "/dev/sda"; - users.users.admin = { - password = "test"; - }; - virtualisation = { - graphics = false; - }; -} diff --git a/infra/production/proxmox/vn-southwest-1/compute/nixos-vm/main.tf b/infra/.modules/proxmox-nixos/main.tf similarity index 100% rename from infra/production/proxmox/vn-southwest-1/compute/nixos-vm/main.tf rename to infra/.modules/proxmox-nixos/main.tf diff --git a/infra/production/proxmox/vn-southwest-1/compute/nixos-vm/terraform.tf b/infra/.modules/proxmox-nixos/terraform.tf similarity index 100% rename from infra/production/proxmox/vn-southwest-1/compute/nixos-vm/terraform.tf rename to infra/.modules/proxmox-nixos/terraform.tf diff --git a/infra/production/proxmox/vn-southwest-1/compute/nixos-vm/variables.tf b/infra/.modules/proxmox-nixos/variables.tf similarity index 100% rename from infra/production/proxmox/vn-southwest-1/compute/nixos-vm/variables.tf rename to infra/.modules/proxmox-nixos/variables.tf diff --git a/infra/local/bootstrap/terragrunt.hcl b/infra/local/bootstrap/terragrunt.hcl index 7683bc0..9629464 100644 --- a/infra/local/bootstrap/terragrunt.hcl +++ b/infra/local/bootstrap/terragrunt.hcl @@ -3,7 +3,7 @@ include "root" { } terraform { - source = find_in_parent_folders(".modules")//bootstrap" + source = "${find_in_parent_folders(".modules")}//bootstrap" } dependency "cluster" { diff --git a/infra/local/cluster/terragrunt.hcl b/infra/local/cluster/terragrunt.hcl index ac4538a..68a12d4 100644 --- a/infra/local/cluster/terragrunt.hcl +++ b/infra/local/cluster/terragrunt.hcl @@ -3,7 +3,7 @@ include "root" { } terraform { - source = find_in_parent_folders(".modules")//local-cluster" + source = "${find_in_parent_folders(".modules")}//local-cluster" } inputs = { diff --git a/infra/nixos/configuration.nix b/infra/nixos/configuration.nix deleted file mode 100644 index eacdbd5..0000000 --- a/infra/nixos/configuration.nix +++ /dev/null @@ -1,67 +0,0 @@ -{ modulesPath, ... }: - -{ - imports = [ - (modulesPath + "/profiles/all-hardware.nix") - ]; - - boot = { - loader = { - systemd-boot = { - enable = true; - }; - efi = { - canTouchEfiVariables = true; - }; - }; - }; - - networking = { - networkmanager = { - enable = true; - }; - }; - - nix = { - settings = { - experimental-features = [ - "nix-command" - "flakes" - ]; - }; - optimise.automatic = true; - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 30d"; - }; - }; - - services = { - openssh = { - enable = true; - }; - qemuGuest = { - enable = true; - }; - }; - - users.users = { - admin = { - isNormalUser = true; - extraGroups = [ - "wheel" - ]; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN5ue4np7cF34f6dwqH1262fPjkowHQ8irfjVC156PCG" - ]; - }; - root = { - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN5ue4np7cF34f6dwqH1262fPjkowHQ8irfjVC156PCG" - ]; - }; - }; - - system.stateVersion = "24.11"; -} diff --git a/infra/nixos/flake.lock b/infra/nixos/flake.lock deleted file mode 100644 index 35c7766..0000000 --- a/infra/nixos/flake.lock +++ /dev/null @@ -1,47 +0,0 @@ -{ - "nodes": { - "disko": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1737038063, - "narHash": "sha256-rMEuiK69MDhjz1JgbaeQ9mBDXMJ2/P8vmOYRbFndXsk=", - "owner": "nix-community", - "repo": "disko", - "rev": "bf0abfde48f469c256f2b0f481c6281ff04a5db2", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "disko", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1737672001, - "narHash": "sha256-YnHJJ19wqmibLQdUeq9xzE6CjrMA568KN/lFPuSVs4I=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "035f8c0853c2977b24ffc4d0a42c74f00b182cd8", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-24.11", - "type": "indirect" - } - }, - "root": { - "inputs": { - "disko": "disko", - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/infra/nixos/flake.nix b/infra/nixos/flake.nix deleted file mode 100644 index 36ffb41..0000000 --- a/infra/nixos/flake.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - inputs = { - nixpkgs.url = "nixpkgs/nixos-24.11"; - disko = { - url = "github:nix-community/disko"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; - outputs = { nixpkgs, disko, ... }: { - nixosConfigurations = { - nixos = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - disko.nixosModules.disko - ./configuration.nix - ./disks.nix - ]; - }; - devbox = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - disko.nixosModules.disko - ./configuration.nix - ./disks.nix - ./profiles/devbox.nix - ]; - }; - k3s = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - disko.nixosModules.disko - ./configuration.nix - ./disks.nix - ./profiles/k3s.nix - ]; - }; - }; - }; -} diff --git a/infra/production/hetzner/helsinki/compute/hetzner-vm/configuration.nix b/infra/production/hetzner/helsinki/compute/hetzner-vm/configuration.nix deleted file mode 100644 index 44e4b41..0000000 --- a/infra/production/hetzner/helsinki/compute/hetzner-vm/configuration.nix +++ /dev/null @@ -1,118 +0,0 @@ -{ pkgs, ... }: - -{ - disko.devices = { - disk = { - main = { - type = "disk"; - # TODO don't hard code device? - device = "/dev/sda"; - content = { - type = "gpt"; - partitions = { - boot = { - size = "1M"; - type = "EF02"; # for grub MBR - }; - ESP = { - size = "1G"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ "umask=0077" ]; - }; - }; - root = { - size = "100%"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - }; - }; - }; - }; - }; - }; - - boot = { - loader = { - systemd-boot = { - enable = true; - }; - efi = { - canTouchEfiVariables = true; - }; - }; - }; - - networking = { - networkmanager = { - enable = true; - }; - firewall = { - # https://docs.k3s.io/installation/requirements#inbound-rules-for-k3s-server-nodes - allowedTCPPorts = [ - 6443 - 10250 - ]; - allowedTCPPortRanges = [ - { from = 2379; to = 2380; } - ]; - }; - }; - - nix = { - settings = { - experimental-features = [ - "nix-command" - "flakes" - ]; - }; - optimise.automatic = true; - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 30d"; - }; - }; - - services = { - openssh.enable = true; - k3s = { - enable = true; - role = "server"; - extraFlags = toString [ - "--disable-helm-controller" - "--disable-network-policy" - "--disable=traefik" - "--secrets-encryption=true" - "--snapshotter=stargz" - - # TODO better ipv6 ipam - "--cluster-cidr=2001:cafe:42::/56" - "--service-cidr=2001:cafe:43::/112" - ]; - }; - }; - - users.users.admin = { - isNormalUser = true; - description = "Admin"; - extraGroups = [ - "networkmanager" - "wheel" - ]; - packages = with pkgs; [ - neovim - git - gnumake - tmux - ]; - }; - - system.stateVersion = "25.05"; -} diff --git a/infra/production/hetzner/helsinki/compute/hetzner-vm/flake.lock b/infra/production/hetzner/helsinki/compute/hetzner-vm/flake.lock deleted file mode 100644 index 88d397f..0000000 --- a/infra/production/hetzner/helsinki/compute/hetzner-vm/flake.lock +++ /dev/null @@ -1,48 +0,0 @@ -{ - "nodes": { - "disko": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1755519972, - "narHash": "sha256-bU4nqi3IpsUZJeyS8Jk85ytlX61i4b0KCxXX9YcOgVc=", - "owner": "nix-community", - "repo": "disko", - "rev": "4073ff2f481f9ef3501678ff479ed81402caae6d", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "disko", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1755593991, - "narHash": "sha256-BA9MuPjBDx/WnpTJ0EGhStyfE7hug8g85Y3Ju9oTsM4=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "a58390ab6f1aa810eb8e0f0fc74230e7cc06de03", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-25.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "disko": "disko", - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/infra/production/hetzner/helsinki/compute/hetzner-vm/flake.nix b/infra/production/hetzner/helsinki/compute/hetzner-vm/flake.nix deleted file mode 100644 index 125ad6f..0000000 --- a/infra/production/hetzner/helsinki/compute/hetzner-vm/flake.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; - disko = { - url = "github:nix-community/disko"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; - - outputs = { self, nixpkgs, disko }: { - nixosConfigurations = { - master = nixpkgs.lib.nixosSystem { - system = "aarch64-linux"; # TODO support multiple systems - modules = [ - disko.nixosModules.disko - ./configuration.nix - ]; - }; - }; - }; -} diff --git a/infra/production/hetzner/helsinki/compute/terragrunt.hcl b/infra/production/hetzner/helsinki/compute/terragrunt.hcl index 1687a63..1801028 100644 --- a/infra/production/hetzner/helsinki/compute/terragrunt.hcl +++ b/infra/production/hetzner/helsinki/compute/terragrunt.hcl @@ -1,6 +1,5 @@ terraform { - # TODO move to modules - source = "./hetzner-vm" + source = "${find_in_parent_folders(".modules")}//hetzner-nixos" } # TODO temp skip diff --git a/infra/production/oracle/bootstrap/terragrunt.hcl b/infra/production/oracle/bootstrap/terragrunt.hcl index afaa8e8..77c4c61 100644 --- a/infra/production/oracle/bootstrap/terragrunt.hcl +++ b/infra/production/oracle/bootstrap/terragrunt.hcl @@ -3,7 +3,7 @@ include "root" { } terraform { - source = find_in_parent_folders(".modules")//bootstrap" + source = "${find_in_parent_folders(".modules")}//bootstrap" } dependency "cluster" { diff --git a/infra/production/oracle/cluster/terragrunt.hcl b/infra/production/oracle/cluster/terragrunt.hcl index e289e37..4149361 100644 --- a/infra/production/oracle/cluster/terragrunt.hcl +++ b/infra/production/oracle/cluster/terragrunt.hcl @@ -4,7 +4,7 @@ include "root" { } terraform { - source = find_in_parent_folders(".modules")//cluster" + source = "${find_in_parent_folders(".modules")}//cluster" } dependency "legacy" { diff --git a/infra/production/oracle/legacy/terragrunt.hcl b/infra/production/oracle/legacy/terragrunt.hcl index 8d6d018..0dc6ce8 100644 --- a/infra/production/oracle/legacy/terragrunt.hcl +++ b/infra/production/oracle/legacy/terragrunt.hcl @@ -4,7 +4,7 @@ include "root" { } terraform { - source = find_in_parent_folders(".modules")//legacy" + source = "${find_in_parent_folders(".modules")}//legacy" } inputs = { diff --git a/infra/production/oracle/secrets/terragrunt.hcl b/infra/production/oracle/secrets/terragrunt.hcl index ec265a7..72c1bf7 100644 --- a/infra/production/oracle/secrets/terragrunt.hcl +++ b/infra/production/oracle/secrets/terragrunt.hcl @@ -4,7 +4,7 @@ include "root" { } terraform { - source = find_in_parent_folders(".modules")//secrets" + source = "${find_in_parent_folders(".modules")}//secrets" } dependency "cluster" { diff --git a/infra/production/proxmox/vn-southwest-1/compute/.terraform.lock.hcl b/infra/production/proxmox/vn-southwest-1/compute/.terraform.lock.hcl index 07c6e0d..37cfbd7 100644 --- a/infra/production/proxmox/vn-southwest-1/compute/.terraform.lock.hcl +++ b/infra/production/proxmox/vn-southwest-1/compute/.terraform.lock.hcl @@ -58,28 +58,6 @@ provider "registry.opentofu.org/hashicorp/null" { ] } -provider "registry.opentofu.org/hashicorp/oci" { - version = "7.15.0" - hashes = [ - "h1:qd075zUzmjgm+W3GezX95h9hjdFkKnCagDzy5RxUf28=", - "zh:2e198d561ab5dbcf84c1984050bbcf5691811aebb22a06af8d946666686ac86b", - "zh:33f242ca79e20069b54847477e8dbe28f965c7df3da05d0e1f31377dd9b24367", - "zh:3d7c961d4b012e5d63588d030e491adf9b980555a5ab3c4510e9b74887aa81ec", - "zh:44265b99500a7bb53e9c7108f0e83df5ebf480261388fc0a565e1785e6349da4", - "zh:478bdb9d0883e74bf7ea11e352dc1e36bdb21d40c887da56675ad8411f7e8fec", - "zh:5898c4ecb3e9f4ebd91a849e40e7925e73b5ef282afaf3f37069274817ebe886", - "zh:5d9c2345e7e25e4cb02c9e4f6ce283ef37c4220c76ac39f1c14b8c9a77905b93", - "zh:5e788eb84430d3872460df71e96c5b0363761a399c729581c13edfb327cbb67f", - "zh:710183628e249f094afcb452a22812d878ae3728b4541adf38e8006087711e96", - "zh:7ebb6d5586735e853d2c7ec6436dad945a72bb360e6a600c8c311d98d8819fda", - "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", - "zh:c9e5b7f0dea6b1a6c1099b3bd64114382102b4dbe839c2dc53b3cd757f39bb4a", - "zh:da2889b73c573531e235fc351f0caec925512fddac864f68812a175779b4b654", - "zh:e12d11047fc78cace1b523791184bab6bf79d6d34fe82f56099313675f709c31", - "zh:fd41831a5f59ed347cf75813491a0894f97b87618efa0b1037e369c260e0446e", - ] -} - provider "registry.opentofu.org/hashicorp/time" { version = "0.13.1" hashes = [ diff --git a/infra/production/proxmox/vn-southwest-1/compute/terragrunt.hcl b/infra/production/proxmox/vn-southwest-1/compute/terragrunt.hcl index 6638eda..54f57f1 100644 --- a/infra/production/proxmox/vn-southwest-1/compute/terragrunt.hcl +++ b/infra/production/proxmox/vn-southwest-1/compute/terragrunt.hcl @@ -4,13 +4,13 @@ include "root" { } terraform { - source = "./nixos-vm" + source = "${find_in_parent_folders(".modules")}//proxmox-nixos" } inputs = { name = "k3s" nixos = { - flake = "${get_terragrunt_dir()}/../../../../nixos" + flake = "${find_in_parent_folders(".modules")}/nixos" host = "k3s" } cpu = { diff --git a/infra/production/tfstate/.terraform.lock.hcl b/infra/production/tfstate/.terraform.lock.hcl deleted file mode 100644 index f10effb..0000000 --- a/infra/production/tfstate/.terraform.lock.hcl +++ /dev/null @@ -1,25 +0,0 @@ -# This file is maintained automatically by "tofu init". -# Manual edits may be lost in future updates. - -provider "registry.opentofu.org/hashicorp/oci" { - version = "7.6.0" - hashes = [ - "h1:fvwp3c4OPhuKW9gBVW8eInqBE/lXZx/gLFEZRUsHuYE=", - "h1:l91jNGp7+F7wgSbEqeqkzPILeUOLVj1mgKMBKeADBn0=", - "zh:07b8c1b8ddbd9cc62296f8573a8f89d282978b0cf3046dd354028811ac371cc6", - "zh:17b42ca6aee04b3c903366d029311e7ffbea630882a93d418fbb364a3d91d8bf", - "zh:1fb9c7841fb556e4d580dc41d906efd40c0d1d7659275b4bb5929f331ee1fea2", - "zh:20325dbb45c495baa0b885dac1c79992998b98415260317e8ca3a45c5d0a7561", - "zh:216a5eb1a5ebcb61feb9bd1b2551d9a0ccbde35857d4bb66eeba7ef240ac8ba3", - "zh:4adedb1709478fb9778cf95d6ba649feb7d508380957c97edcdf5e8ff3f686c8", - "zh:62b6c705523ceff1b55ab8863e4ec80829b15e4890a9e9d8f0ed4dcb73630a97", - "zh:7aec9c64f308cf3eb9d85ebd2dc2518c97ef71c86c75bb64507c0c22f8dd6c01", - "zh:8131877e0ec3ec868b09d3e3e4d6e0b7706989e6bd30ed4aeba3695f6de04888", - "zh:9978257ee7fd7a0ea090e1c8d085e93687e43d0a7607271bc8011c282b7160a4", - "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", - "zh:b51e7e20316c0181025628e32daf1f6760d42dd53f9f9de135a41ad893a1d1c7", - "zh:c9aaafa914f161587dd3ab3b9b0a867da303f8c41256dfe795414364830d6180", - "zh:f3db696340ea890cb41adf9bdae19e6b0132bc29a731260145cbf64f56831a18", - "zh:fea0c8888a0e2b8d3523f6888a7faa3aa13df79d954089d776db4f9a96d2215f", - ] -} diff --git a/infra/production/tfstate/terragrunt.hcl b/infra/production/tfstate/terragrunt.hcl index 0ba7931..757dd28 100644 --- a/infra/production/tfstate/terragrunt.hcl +++ b/infra/production/tfstate/terragrunt.hcl @@ -4,7 +4,7 @@ include "root" { } terraform { - source = find_in_parent_folders(".modules")//tfstate" + source = "${find_in_parent_folders(".modules")}//tfstate" before_hook "bootstrap_tfstate" { commands = ["init", "plan", "apply"] -- 2.51.2