nix-config/hosts/microwave/network.nix

67 lines
1.5 KiB
Nix
Raw Normal View History

{ pkgs, config, ... }: {
environment.systemPackages = with pkgs; [
iwgtk
];
networking = {
hostName = "microwave"; # Define your hostname.
2022-07-15 05:05:04 +02:00
hostId = "7da4f1e6";
firewall.enable = true;
networkmanager.enable = false;
useNetworkd = true;
wireguard.enable = true;
wireless.iwd = {
enable = true;
};
};
services.resolved = {
enable = true;
2022-09-14 19:27:50 +02:00
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"
];
2022-07-13 15:52:14 +02:00
systemd.network = {
enable = true;
# wait-online.ignoredInterfaces = [ "wlan0" "enp53s0" ];
2022-07-13 15:52:14 +02:00
# 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.Name = "enp53s0";
networkConfig = {
Bond = "james";
PrimarySlave = true;
};
};
networks."10-wlan-bond" = {
matchConfig.Name = "wlan0";
networkConfig = {
Bond = "james";
};
};
networks."10-james-bond" = {
matchConfig.Name = "james";
networkConfig = {
DHCP = "yes";
IPv6AcceptRA = true;
};
2022-07-13 15:52:14 +02:00
};
2022-07-13 15:45:24 +02:00
};
}