about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2023-05-12 14:07:07 -0700
committerFranck Cuny <franck@fcuny.net>2023-05-12 14:07:07 -0700
commitdedafea9064419b7b2dcb190457450232a46cf0a (patch)
treebae38d282004a699269e5146ea8bea21094af34d
parenthosts/aptos: move network configuration to default.nix (diff)
downloadworld-dedafea9064419b7b2dcb190457450232a46cf0a.tar.gz
hosts/tahoe: move network configuration to default.nix
Diffstat (limited to '')
-rw-r--r--hosts/tahoe/default.nix22
-rw-r--r--hosts/tahoe/networking.nix30
2 files changed, 20 insertions, 32 deletions
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 [ ];
-}