NixOS on Hetzner cloud servers: IPv6

I’m running NixOS on a Hetzner cloud server, but unfortunately, IPv6 does not work (“Destination unreachable: Address unreachable”).
Has anyone got it running and can tell me how to configure IPv6 routing?

The configuration on Debian is:

auto eth0:0
iface eth0:0 inet6 static
    address 2a01:....:....:....::1/64
    gateway fe80::1
    post-up route add -A inet6 default gw fe80::1%eth0 || true
    pre-down route del -A inet6 default gw fe80::1%eth0 || true

This might be an occurrence of a common issue on Hetzner servers which is caused by their router equipment. If so, it probably works for a couple of minutes after boot: try checking if it works immediately after boot. If so, pester Hetzner’s support about it :wink:

Now, I’ve solved it; the reason it did not work was a wrong IPv6-address.
So, IPv6 on Hetzner cloud servers works with:

networking.interfaces.ens3.ipv6.addresses = [ { address = "2a01:4f8:....:....::1"; prefixLength = 64; } ];
networking.defaultGateway6 = { address = "fe80::1"; interface = "ens3"; };

(replace .... by the IPv6-address-parts of your server, and maybe ens3 by the name of your ethernet-device)