From 63d5e2d00ea24d8dfab6f228e8721e3d12b80698 Mon Sep 17 00:00:00 2001 From: Astrid Yu Date: Sun, 28 Apr 2024 21:37:57 -0700 Subject: [PATCH] thatcher: switch to use systemd-networkd --- machines/thatcher/configuration.nix | 2 ++ machines/thatcher/net.nix | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 machines/thatcher/net.nix diff --git a/machines/thatcher/configuration.nix b/machines/thatcher/configuration.nix index 3dc893f3..da5dd0e4 100644 --- a/machines/thatcher/configuration.nix +++ b/machines/thatcher/configuration.nix @@ -5,6 +5,8 @@ in with lib; { imports = [ (modulesPath + "/profiles/qemu-guest.nix") inputs.self.nixosModules.server + + ./net.nix ]; services.qemuGuest.enable = true; diff --git a/machines/thatcher/net.nix b/machines/thatcher/net.nix new file mode 100644 index 00000000..02544542 --- /dev/null +++ b/machines/thatcher/net.nix @@ -0,0 +1,23 @@ +{ pkgs, lib, ... }: +with lib; { + networking.useDHCP = false; + + systemd.network = { + enable = true; + + networks."10-base-ens" = { + name = "ens*"; + matchConfig.Type = "ether"; + networkConfig = { + Description = "Primary network connection"; + DHCP = "yes"; + IPv6AcceptRA = true; + }; + address = [ + "100.64.0.45/31" + "2a11:f2c0:3:16::1/64" + ]; + routes = [{ routeConfig.Gateway = "100.64.0.44"; }]; + }; + }; +}