2020-04-18 21:04:14 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
2020-05-11 06:39:22 +02:00
|
|
|
environment.systemPackages = with pkgs; [ avahi wireguard ];
|
2020-04-18 21:04:14 +02:00
|
|
|
|
|
|
|
# Set hostname and hostid
|
|
|
|
networking = {
|
|
|
|
hostName = "panacea";
|
2020-05-08 21:53:52 +02:00
|
|
|
hostId = "8feb0bb8";
|
2020-05-11 06:39:22 +02:00
|
|
|
wireless.enable = true;
|
2020-04-18 21:04:14 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
# Enable zeroconf
|
|
|
|
services.avahi = {
|
|
|
|
enable = true;
|
|
|
|
nssmdns = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Wireguard setup
|
2020-05-11 06:39:22 +02:00
|
|
|
networking.wg-quick.interfaces = {
|
2020-04-18 21:04:14 +02:00
|
|
|
wg0 = {
|
2020-05-11 06:39:22 +02:00
|
|
|
address = [ "10.8.0.4/32" ];
|
2020-04-18 21:04:14 +02:00
|
|
|
privateKeyFile = "/home/coolneng/.wg/keys/privatekey";
|
2020-05-11 06:39:22 +02:00
|
|
|
dns = [ "198.100.148.224" "151.80.222.79" ];
|
2020-04-18 21:04:14 +02:00
|
|
|
peers = [
|
|
|
|
# zion
|
|
|
|
{
|
|
|
|
publicKey = "GN8lqPBZYOulh6xD4GhkoEWI65HMMCpSxJSH5871YnU=";
|
|
|
|
allowedIPs = [ "0.0.0.0/0" ];
|
|
|
|
endpoint = "coolneng.duckdns.org:1194";
|
|
|
|
persistentKeepalive = 25;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|