panacea/modules/networking.nix

42 lines
774 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
avahi
wireguard
];
# Set hostname and hostid
networking = {
hostName = "panacea";
2020-05-08 20:55:53 +02:00
hostId = "a434d9ed230d";
wireless = {
enable = true;
}
};
# Enable zeroconf
services.avahi = {
enable = true;
nssmdns = true;
};
# Wireguard setup
networking.wireguard.interfaces = {
wg0 = {
ips = [ "10.8.0.4/32" ];
privateKeyFile = "/home/coolneng/.wg/keys/privatekey";
peers = [
# zion
{
publicKey = "GN8lqPBZYOulh6xD4GhkoEWI65HMMCpSxJSH5871YnU=";
allowedIPs = [ "0.0.0.0/0" ];
endpoint = "coolneng.duckdns.org:1194";
persistentKeepalive = 25;
}
];
};
};
}