feat: floating ip

This commit is contained in:
2026-06-09 15:43:23 +00:00
parent e3ee881db6
commit bd92610a98
2 changed files with 10 additions and 1 deletions
@@ -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 { device = lib.mkOption {
type = lib.types.str; type = lib.types.str;
default = if isNewer then "/dev/nvme0n1" else "/dev/sda"; default = if isNewer then "/dev/nvme0n1" else "/dev/sda";
@@ -95,7 +103,7 @@ in {
address = [ address = [
"${cfg.ipv4}/32" "${cfg.ipv4}/32"
"${cfg.ipv6}::/64" "${cfg.ipv6}::/64"
]; ] ++ lib.optional (cfg.floatingIpv4 != null) "${cfg.floatingIpv4}/32";
routes = [ routes = [
{ Gateway = "172.31.1.1"; GatewayOnLink = true; } { Gateway = "172.31.1.1"; GatewayOnLink = true; }
{ Gateway = "fe80::1"; } { Gateway = "fe80::1"; }
+1
View File
@@ -80,6 +80,7 @@ in {
enable = true; enable = true;
networkMatchConfigName = "enp1s0"; networkMatchConfigName = "enp1s0";
ipv4 = "128.140.75.58"; ipv4 = "128.140.75.58";
floatingIpv4 = "78.47.243.0";
ipv6 = "2a01:4f8:c2c:d54a"; ipv6 = "2a01:4f8:c2c:d54a";
}; };
services.matrix = { services.matrix = {