nixos-infect emitted defaultGateway6.address="" and ipv6.routes=[{address="";
prefixLength=128}] for this v4-only Hetzner instance, so network-addresses-eth0.service
failed at boot ("ip route add /128 ... any valid prefix is expected rather than /128").
The box has no real IPv6 (link-local only, kernel-managed), so remove the empty IPv6
gateway, address, and route. IPv4 unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
36 lines
1.3 KiB
Nix
36 lines
1.3 KiB
Nix
# Hetzner static networking — generated by nixos-infect at provision time.
|
|
#
|
|
# This file is server-specific: the IP, gateway, and MAC address are tied to a
|
|
# particular Hetzner instance. When provisioning a new server:
|
|
# 1. After `terraform apply` + nixos-infect completes, run:
|
|
# ssh root@<new-ip> 'cat /etc/nixos/networking.nix'
|
|
# 2. Replace this file's contents with the output and commit.
|
|
# 3. Then: `nixos-rebuild switch --flake .#cc-ci-hetzner --target-host root@<new-ip>`
|
|
#
|
|
# Current instance: 91.98.47.73 (fsn1, Hetzner server 134485294, provisioned 2026-05-31).
|
|
{ lib, ... }: {
|
|
networking = {
|
|
nameservers = [
|
|
"185.12.64.1"
|
|
"185.12.64.2"
|
|
];
|
|
defaultGateway = "172.31.1.1";
|
|
# No IPv6 on this Hetzner instance (link-local only) — nixos-infect emitted an empty
|
|
# defaultGateway6/ipv6.route which made network-addresses-eth0.service fail
|
|
# ("ip route add /128" with no prefix). v4-only box, so no IPv6 gateway/route declared.
|
|
dhcpcd.enable = false;
|
|
usePredictableInterfaceNames = lib.mkForce false;
|
|
interfaces = {
|
|
eth0 = {
|
|
ipv4.addresses = [
|
|
{ address = "91.98.47.73"; prefixLength = 32; }
|
|
];
|
|
ipv4.routes = [{ address = "172.31.1.1"; prefixLength = 32; }];
|
|
};
|
|
};
|
|
};
|
|
services.udev.extraRules = ''
|
|
ATTR{address}=="92:00:08:04:15:2e", NAME="eth0"
|
|
'';
|
|
}
|