From 5f6ba8e29db0bb2676821cab74a9a68e43d11b5c Mon Sep 17 00:00:00 2001 From: Romain Paquet Date: Mon, 24 Nov 2025 17:11:04 +0100 Subject: [PATCH] infra: add flake module and crocus exports --- flake.nix | 1 + infra/crocus.tf | 4 ++++ infra/flake-module.nix | 18 ++++++++++++++++++ infra/outputs.json | 5 +++++ 4 files changed, 28 insertions(+) create mode 100644 infra/flake-module.nix 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",