From bd92610a98ef462c88879ceb296db2a3ccf2442a Mon Sep 17 00:00:00 2001 From: yukkop Date: Tue, 9 Jun 2026 15:43:23 +0000 Subject: [PATCH] feat: floating ip --- nixos/module/hectic/hardware/hetzner-cloud.nix | 10 +++++++++- nixos/system/hectic-lab/hectic-lab.nix | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/nixos/module/hectic/hardware/hetzner-cloud.nix b/nixos/module/hectic/hardware/hetzner-cloud.nix index 32e99714..d3316f0c 100644 --- a/nixos/module/hectic/hardware/hetzner-cloud.nix +++ b/nixos/module/hectic/hardware/hetzner-cloud.nix @@ -51,6 +51,14 @@ in { ''; }; + floatingIpv4 = lib.mkOption { + type = with lib.types; nullOr (strMatching "^([0-9]{1,3}\\.){3}[0-9]{1,3}$"); + default = null; + example = "188.243.124.247"; + description = '' + Optional Hetzner Floating IPv4 configured as `/32` on the primary interface. + ''; + }; device = lib.mkOption { type = lib.types.str; default = if isNewer then "/dev/nvme0n1" else "/dev/sda"; @@ -95,7 +103,7 @@ in { address = [ "${cfg.ipv4}/32" "${cfg.ipv6}::/64" - ]; + ] ++ lib.optional (cfg.floatingIpv4 != null) "${cfg.floatingIpv4}/32"; routes = [ { Gateway = "172.31.1.1"; GatewayOnLink = true; } { Gateway = "fe80::1"; } diff --git a/nixos/system/hectic-lab/hectic-lab.nix b/nixos/system/hectic-lab/hectic-lab.nix index 7022ec06..842c1ffc 100644 --- a/nixos/system/hectic-lab/hectic-lab.nix +++ b/nixos/system/hectic-lab/hectic-lab.nix @@ -80,6 +80,7 @@ in { enable = true; networkMatchConfigName = "enp1s0"; ipv4 = "128.140.75.58"; + floatingIpv4 = "78.47.243.0"; ipv6 = "2a01:4f8:c2c:d54a"; }; services.matrix = {