panacea/modules/networking.nix

43 lines
874 B
Nix

{ config, lib, pkgs, ... }:
{
# Set hostname, hostid and enable WiFi
networking = {
hostName = "panacea";
hostId = "8feb0bb8";
wireless.iwd.enable = true;
enableIPv6 = false;
};
# Enable systemd-networkd
networking = {
useDHCP = false;
interfaces = {
enp0s31f6.useDHCP = true;
wlan0.useDHCP = true;
};
useNetworkd = true;
dhcpcd.enable = false;
};
systemd.services."systemd-networkd-wait-online".enable = false;
# Static IP for home network
systemd.network.networks."24-home" = {
name = "wlan0";
matchConfig = {
Name = "wlan0";
SSID = "WiFi-5.0-CE42";
};
address = [ "192.168.1.131/24" ];
gateway = [ "192.168.1.1" ];
dns = [ "192.168.1.2" ];
networkConfig.DNSSEC = "no";
};
# Enable zeroconf
services.avahi = {
enable = true;
nssmdns = true;
};
}