diff --git a/hosts/kalessin/default.nix b/hosts/kalessin/default.nix index 7047dff..a3b86ab 100644 --- a/hosts/kalessin/default.nix +++ b/hosts/kalessin/default.nix @@ -3,8 +3,10 @@ { imports = [ ./hardware-configuration.nix + ./networking.nix ]; + nixpkgs.hostPlatform = "aarch64-linux"; networking.hostName = "kalessin"; networking.hostId = "534b538e"; diff --git a/hosts/kalessin/hardware-configuration.nix b/hosts/kalessin/hardware-configuration.nix index a80e477..1007f6f 100644 --- a/hosts/kalessin/hardware-configuration.nix +++ b/hosts/kalessin/hardware-configuration.nix @@ -35,14 +35,4 @@ }; swapDevices = [ ]; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - # networking.useDHCP = lib.mkDefault true; - networking.useNetworkd = true; - networking.interfaces.enp0s6.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; } diff --git a/hosts/kalessin/networking.nix b/hosts/kalessin/networking.nix new file mode 100644 index 0000000..3c27781 --- /dev/null +++ b/hosts/kalessin/networking.nix @@ -0,0 +1,6 @@ +{ config, lib, pkgs, ... }: + +{ + networking.useNetworkd = true; + networking.interfaces.enp0s6.useDHCP = true; +} diff --git a/hosts/orm/default.nix b/hosts/orm/default.nix index a042e95..004ebd4 100644 --- a/hosts/orm/default.nix +++ b/hosts/orm/default.nix @@ -3,26 +3,16 @@ { imports = [ ./hardware-configuration.nix + ./networking.nix ]; + nixpkgs.hostPlatform = "x86_64-linux"; networking.hostName = "orm"; networking.hostId = "00000000"; users.users.qenya.extraGroups = [ "wheel" ]; qenya.base-server.enable = true; - age.secrets.wireguard-peer-orm = { - file = ../../secrets/wireguard-peer-orm.age; - owner = "root"; - group = "systemd-network"; - mode = "640"; - }; - - birdsong.peering = { - enable = true; - privateKeyFile = config.age.secrets.wireguard-peer-orm.path; - }; - randomcat.services.zfs.datasets = { "rpool_orm/state" = { mountpoint = "none"; }; "rpool_orm/state/actual" = { mountpoint = "/var/lib/actual"; }; diff --git a/hosts/orm/hardware-configuration.nix b/hosts/orm/hardware-configuration.nix index eddc71e..34ef7b3 100644 --- a/hosts/orm/hardware-configuration.nix +++ b/hosts/orm/hardware-configuration.nix @@ -37,14 +37,4 @@ swapDevices = [ { device = "/dev/disk/by-uuid/a0ac8f60-25f9-4dec-af70-e3f4cd36c575"; } ]; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - # networking.useDHCP = lib.mkDefault true; - networking.useNetworkd = true; - networking.interfaces.ens3.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; } diff --git a/hosts/orm/networking.nix b/hosts/orm/networking.nix new file mode 100644 index 0000000..d69a0ae --- /dev/null +++ b/hosts/orm/networking.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +{ + networking.useNetworkd = true; + networking.interfaces.ens3.useDHCP = true; + + age.secrets.wireguard-peer-orm = { + file = ../../secrets/wireguard-peer-orm.age; + owner = "root"; + group = "systemd-network"; + mode = "640"; + }; + + birdsong.peering = { + enable = true; + privateKeyFile = config.age.secrets.wireguard-peer-orm.path; + }; +} diff --git a/hosts/yevaud/default.nix b/hosts/yevaud/default.nix index aae386f..7ff5928 100644 --- a/hosts/yevaud/default.nix +++ b/hosts/yevaud/default.nix @@ -3,27 +3,16 @@ { imports = [ ./hardware-configuration.nix + ./networking.nix ]; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; networking.hostName = "yevaud"; networking.hostId = "09673d65"; users.users.qenya.extraGroups = [ "wheel" ]; - qenya.base-server.enable = true; - age.secrets.wireguard-peer-yevaud = { - file = ../../secrets/wireguard-peer-yevaud.age; - owner = "root"; - group = "systemd-network"; - mode = "640"; - }; - - birdsong.peering = { - enable = true; - privateKeyFile = config.age.secrets.wireguard-peer-yevaud.path; - }; - services.bind = { # enable = true; cacheNetworks = [ "10.127.0.0/16" "fd70:81ca:0f8f::/48" ]; diff --git a/hosts/yevaud/hardware-configuration.nix b/hosts/yevaud/hardware-configuration.nix index 713cc0a..72da1b4 100644 --- a/hosts/yevaud/hardware-configuration.nix +++ b/hosts/yevaud/hardware-configuration.nix @@ -37,14 +37,4 @@ swapDevices = [ { device = "/dev/disk/by-uuid/f8b6eb35-33ad-4e19-bf3d-cac5ec38a8dc"; } ]; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - # networking.useDHCP = lib.mkDefault true; - networking.useNetworkd = true; - networking.interfaces.ens3.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; } diff --git a/hosts/yevaud/networking.nix b/hosts/yevaud/networking.nix new file mode 100644 index 0000000..31e1de8 --- /dev/null +++ b/hosts/yevaud/networking.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +{ + networking.useNetworkd = true; + networking.interfaces.ens3.useDHCP = true; + + age.secrets.wireguard-peer-yevaud = { + file = ../../secrets/wireguard-peer-yevaud.age; + owner = "root"; + group = "systemd-network"; + mode = "640"; + }; + + birdsong.peering = { + enable = true; + privateKeyFile = config.age.secrets.wireguard-peer-yevaud.path; + }; +}