From 9fae53fac71b02b15cd364b592d452e36949acc9 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Mon, 19 Nov 2018 02:03:22 +0100 Subject: [PATCH] fixup! nix/os/devices/CFB4ED74: add static ipv6 static address --- nix/os/devices/CFB4ED74/system.nix | 23 ++++++++++++++++++----- nix/os/devices/{default.nix => disk.nix} | 0 2 files changed, 18 insertions(+), 5 deletions(-) rename nix/os/devices/{default.nix => disk.nix} (100%) diff --git a/nix/os/devices/CFB4ED74/system.nix b/nix/os/devices/CFB4ED74/system.nix index b2ff413..5fb7add 100644 --- a/nix/os/devices/CFB4ED74/system.nix +++ b/nix/os/devices/CFB4ED74/system.nix @@ -15,12 +15,17 @@ in { # iperf3 5201 ]; + + networking.useDHCP = true; + networking.usePredictableInterfaceNames = false; networking.interfaces.eth0 = { - useDHCP = true; - ipv6.addresses = [ { - address = "2a02:c207:3003:2387::1"; - prefixLength = 64; - } ]; + ipv6.addresses = [ + { address = "2a02:c207:3003:2387::1"; prefixLength = 64; } + ]; + }; + networking.defaultGateway6 = { + address = "fe80::1"; + interface = "eth0"; }; # Kubernetes @@ -43,4 +48,12 @@ in { authorizedKeys = keys.users.steveej.openssh; }; }; + + boot.initrd.postMountCommands = '' + for iface in $(cd /sys/class/net && ls); do + echo "Bringing down $iface..." + ip address flush dev $iface + ip link set $iface down + done + ''; } diff --git a/nix/os/devices/default.nix b/nix/os/devices/disk.nix similarity index 100% rename from nix/os/devices/default.nix rename to nix/os/devices/disk.nix