diff --git a/flake.nix b/flake.nix index 7019ce5..6117968 100644 --- a/flake.nix +++ b/flake.nix @@ -19,6 +19,7 @@ ./clanServices/flake-module.nix ./devShells/flake-module.nix ./home-manager/flake-module.nix + ./infra/flake-module.nix ./modules/flake-module.nix ./packages/flake-module.nix ]; diff --git a/infra/crocus.tf b/infra/crocus.tf index ccda070..2ac53cb 100644 --- a/infra/crocus.tf +++ b/infra/crocus.tf @@ -62,3 +62,7 @@ resource "hcloud_firewall" "crocus_firewall" { source_ips = ["0.0.0.0/0", "::/0"] } } + +output "crocus_ipv4" { + value = hcloud_primary_ip.crocus_ipv4.ip_address +} diff --git a/infra/flake-module.nix b/infra/flake-module.nix new file mode 100644 index 0000000..8652548 --- /dev/null +++ b/infra/flake-module.nix @@ -0,0 +1,18 @@ +{ + flake.infra = + let + tf_outputs = builtins.fromJSON (builtins.readFile ../infra/outputs.json); + in + { + machines = { + verbena = { + ipv4 = tf_outputs.verbena_ipv4.value; + ipv6 = tf_outputs.verbena_ipv6.value; + gateway6 = tf_outputs.verbena_gateway6.value; + }; + crocus = { + ipv4 = tf_outputs.crocus_ipv4.value; + }; + }; + }; +} diff --git a/infra/outputs.json b/infra/outputs.json index 6c7c237..925eb81 100644 --- a/infra/outputs.json +++ b/infra/outputs.json @@ -1,4 +1,9 @@ { + "crocus_ipv4": { + "sensitive": false, + "type": "string", + "value": "116.203.18.122" + }, "verbena_gateway6": { "sensitive": false, "type": "string",