From dedafea9064419b7b2dcb190457450232a46cf0a Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Fri, 12 May 2023 14:07:07 -0700 Subject: hosts/tahoe: move network configuration to default.nix --- hosts/tahoe/default.nix | 22 ++++++++++++++++++++-- hosts/tahoe/networking.nix | 30 ------------------------------ 2 files changed, 20 insertions(+), 32 deletions(-) delete mode 100644 hosts/tahoe/networking.nix (limited to 'hosts/tahoe') diff --git a/hosts/tahoe/default.nix b/hosts/tahoe/default.nix index ade4b5b..2c4d8ec 100644 --- a/hosts/tahoe/default.nix +++ b/hosts/tahoe/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, hostname, self, ... }: +{ config, pkgs, hostname, lib, self, ... }: let secrets = config.age.secrets; in @@ -6,7 +6,6 @@ in imports = [ ./boot.nix ./hardware.nix - ./networking.nix ./services.nix "${self}/profiles/btrfs.nix" "${self}/profiles/nas.nix" @@ -20,6 +19,25 @@ in "${self}/profiles/hardware/amd.nix" ]; + # Use systemd-networkd for networking + systemd.network.enable = true; + systemd.network.networks.enp42s0 = { + matchConfig.Name = "enp42s0"; + networkConfig.DHCP = "yes"; + dhcpV4Config = { + UseDNS = "yes"; + UseDomains = "yes"; + }; + }; + + networking.useNetworkd = true; + networking.useDHCP = false; + networking.firewall.enable = false; + networking.private-wireguard.enable = true; + + services.nscd.enable = false; + system.nssModules = lib.mkForce [ ]; + my.services.backup = { enable = true; repository = "/data/slow/backups/hosts/${config.networking.hostName}"; diff --git a/hosts/tahoe/networking.nix b/hosts/tahoe/networking.nix deleted file mode 100644 index 8ea6667..0000000 --- a/hosts/tahoe/networking.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ lib, ... }: - -{ - # Use systemd-networkd for networking - systemd.network = { - enable = true; - networks = { - enp42s0 = { - matchConfig.Name = "enp42s0"; - networkConfig = { DHCP = "yes"; }; - extraConfig = '' - [DHCPv4] - UseDNS=yes - UseDomains=yes - ''; - }; - }; - }; - - networking = { - hostName = "tahoe"; - useNetworkd = true; - useDHCP = false; - private-wireguard.enable = true; - firewall.enable = false; - }; - - services.nscd.enable = false; - system.nssModules = lib.mkForce [ ]; -} -- cgit 1.4.1