From f690251f1344e65c1f40492b09f355b0b3b00d6a Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Mon, 9 Jan 2023 23:07:46 +0100 Subject: toaster: basic config, nixpkgs-fmt --- hosts/toaster/network.nix | 62 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 hosts/toaster/network.nix (limited to 'hosts/toaster/network.nix') diff --git a/hosts/toaster/network.nix b/hosts/toaster/network.nix new file mode 100644 index 0000000..239ee0e --- /dev/null +++ b/hosts/toaster/network.nix @@ -0,0 +1,62 @@ +{ config, pkgs, ... }: { + environment.systemPackages = with pkgs; [ iwgtk ]; + + networking = { + hostName = "toaster"; + firewall.enable = true; + networkmanager.enable = false; + useNetworkd = true; + wireguard.enable = true; + wireless.iwd.enable = true; + }; + + services.resolved = { + enable = true; + dnssec = "allow-downgrade"; + }; + + # workaround for networkd waiting for shit + systemd.services.systemd-networkd-wait-online.serviceConfig.ExecStart = [ + "" # clear old command + "${config.systemd.package}/lib/systemd/systemd-networkd-wait-online --any" + ]; + + systemd.network = { + enable = true; + + # wait-online.ignoredInterfaces = [ "wlan0" "enp53s0" ]; + + # Interfaces on the machine + netdevs."10-james" = { + netdevConfig = { + Name = "james"; + Kind = "bond"; + }; + bondConfig = { + Mode = "active-backup"; + PrimaryReselectPolicy = "always"; + MIIMonitorSec = "1s"; + }; + }; + networks."10-ether-bond" = { + matchConfig.MACAddress = "e8:80:88:2f:c6:70"; + networkConfig = { + Bond = "james"; + PrimarySlave = true; + }; + }; + networks."10-wlan-bond" = { + matchConfig.MACAddress = "04:7b:cb:2a:aa:8c"; + networkConfig = { + Bond = "james"; + }; + }; + networks."10-james-bond" = { + matchConfig.Name = "james"; + networkConfig = { + DHCP = "yes"; + IPv6AcceptRA = true; + }; + }; + }; +} -- cgit v1.3.1