nix-config/hosts/toaster/network.nix

64 lines
1.5 KiB
Nix
Raw Normal View History

2023-01-09 23:07:46 +01:00
{ 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";
matchConfig.Name = "wlan0";
2023-01-09 23:07:46 +01:00
networkConfig = {
Bond = "james";
};
};
networks."10-james-bond" = {
matchConfig.Name = "james";
networkConfig = {
DHCP = "yes";
IPv6AcceptRA = true;
};
};
};
}