Compare commits

..

2 Commits

Author SHA1 Message Date
coolneng fbceccefe6
Migrate to systemd-networkd 2022-03-28 18:08:23 +02:00
coolneng ea8e8a25e9
Remove redundant localhost SSH 2022-03-28 16:37:01 +02:00
1 changed files with 25 additions and 26 deletions

View File

@ -9,35 +9,34 @@
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;
};
# Wireguard setup
networking.wg-quick.interfaces = {
home = {
address = [ "10.8.0.2/32" ];
privateKeyFile = config.age.secrets.wireguard.path;
dns = [ "10.8.0.1" ];
peers = [
# zion
{
publicKey = "GN8lqPBZYOulh6xD4GhkoEWI65HMMCpSxJSH5871YnU=";
allowedIPs = [ "0.0.0.0/0" ];
endpoint = "coolneng.duckdns.org:1194";
}
];
};
};
# Enable localhost SSH
services.openssh = {
enable = true;
permitRootLogin = "yes";
passwordAuthentication = false;
openFirewall = false;
startWhenNeeded = true;
};
}