2020-04-18 21:04:14 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
2020-05-14 02:09:23 +02:00
|
|
|
# Set hostname, hostid and enable WiFi
|
2020-04-18 21:04:14 +02:00
|
|
|
networking = {
|
|
|
|
hostName = "panacea";
|
2020-05-08 21:53:52 +02:00
|
|
|
hostId = "8feb0bb8";
|
2020-12-20 20:54:53 +01:00
|
|
|
wireless.iwd.enable = true;
|
2020-07-17 12:07:57 +02:00
|
|
|
enableIPv6 = false;
|
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 = {
|
2021-04-06 15:13:58 +02:00
|
|
|
home = {
|
2020-06-10 01:19:20 +02:00
|
|
|
address = [ "10.8.0.2/32" ];
|
2021-08-09 02:10:51 +02:00
|
|
|
privateKeyFile = config.age.secrets.wireguard.path;
|
2020-12-01 11:05:38 +01:00
|
|
|
dns = [ "10.8.0.1" ];
|
2020-04-18 21:04:14 +02:00
|
|
|
peers = [
|
|
|
|
# zion
|
|
|
|
{
|
|
|
|
publicKey = "GN8lqPBZYOulh6xD4GhkoEWI65HMMCpSxJSH5871YnU=";
|
|
|
|
allowedIPs = [ "0.0.0.0/0" ];
|
|
|
|
endpoint = "coolneng.duckdns.org:1194";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2021-04-06 15:13:58 +02:00
|
|
|
coace = {
|
2021-03-17 13:10:11 +01:00
|
|
|
address = [ "10.9.0.2/32" ];
|
2021-08-09 02:10:51 +02:00
|
|
|
privateKeyFile = config.age.secrets.wireguard.path;
|
2021-03-17 13:10:11 +01:00
|
|
|
peers = [
|
|
|
|
# unit
|
|
|
|
{
|
|
|
|
publicKey = "SYfPEKJkO3HaCiQdV/iionsS6CEjLcLt9C0x0Ib3tEU=";
|
2021-04-07 12:12:43 +02:00
|
|
|
allowedIPs = [ "10.9.0.1/32" "10.0.1.0/24" "10.0.0.0/24" ];
|
2021-03-30 16:08:08 +02:00
|
|
|
endpoint = "coace.duckdns.org:1194";
|
2021-03-17 13:10:11 +01:00
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2020-04-18 21:04:14 +02:00
|
|
|
};
|
|
|
|
|
2020-05-14 02:09:23 +02:00
|
|
|
# Enable localhost SSH
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
permitRootLogin = "yes";
|
|
|
|
passwordAuthentication = false;
|
|
|
|
openFirewall = false;
|
|
|
|
startWhenNeeded = true;
|
|
|
|
};
|
2020-04-18 21:04:14 +02:00
|
|
|
}
|