From 67dfb365b88d08784d28e30c0ee55ca1f9fd2e8e Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Sun, 31 Mar 2024 03:56:59 +0200 Subject: [PATCH] alpha: static ipv4 configuration --- hosts/alpha/hardware.nix | 3 --- hosts/alpha/network.nix | 10 +++++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/hosts/alpha/hardware.nix b/hosts/alpha/hardware.nix index c7b8c9c..d3b2dca 100644 --- a/hosts/alpha/hardware.nix +++ b/hosts/alpha/hardware.nix @@ -39,8 +39,5 @@ } ]; - # Enables DHCP on all ethernet and wireless LAN interfaces. - networking.useDHCP = lib.mkDefault true; - nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; } diff --git a/hosts/alpha/network.nix b/hosts/alpha/network.nix index f7bcc9e..475b37d 100644 --- a/hosts/alpha/network.nix +++ b/hosts/alpha/network.nix @@ -5,13 +5,21 @@ }: { systemd.network = { # Main interface + # https://nixos.wiki/wiki/Install_NixOS_on_Hetzner_Cloud networks."10-lan" = { name = "enp1s0"; - networkConfig.DHCP = "ipv4"; address = [ + "116.203.179.206/32" "2a01:4f8:c2c:71c0::/64" ]; routes = [ + {routeConfig = {Destination = "172.31.1.1";};} + { + routeConfig = { + Gateway = "172.31.1.1"; + GatewayOnLink = true; + }; + } {routeConfig = {Gateway = "fe80::1";};} ]; };