2022-12-29 16:46:51 +01:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
imports =
|
|
|
|
[
|
|
|
|
./hardware-configuration.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
boot.kernelParams = [ "console=ttyS0,115200n8" ];
|
|
|
|
|
|
|
|
boot.loader.grub.enable = true;
|
|
|
|
boot.loader.grub.version = 2;
|
|
|
|
boot.loader.grub.device = "/dev/sda";
|
|
|
|
boot.loader.grub.extraConfig = "
|
|
|
|
serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1
|
|
|
|
terminal_input serial
|
|
|
|
terminal_output serial
|
|
|
|
";
|
|
|
|
|
|
|
|
networking.hostName = "beryllium";
|
|
|
|
|
2022-12-30 17:47:12 +01:00
|
|
|
networking.firewall.enable = false;
|
|
|
|
|
2022-12-29 22:50:34 +01:00
|
|
|
networking.iproute2.enable = true;
|
|
|
|
networking.iproute2.rttablesExtraConfig = ''
|
|
|
|
200 wg-clerie
|
|
|
|
'';
|
|
|
|
|
2022-12-29 17:02:22 +01:00
|
|
|
petabyte.policyrouting = {
|
|
|
|
enable = true;
|
|
|
|
rules6 = [
|
2022-12-29 22:50:34 +01:00
|
|
|
{ rule = "from 2a01:4f8:c0c:15f1::8107/128 lookup wg-clerie"; prio = 20000; }
|
2022-12-29 17:02:22 +01:00
|
|
|
{ rule = "from 2a01:4f8:c0c:15f1::8107/128 unreachable"; prio = 20001; }
|
|
|
|
];
|
|
|
|
rules4 = [
|
2022-12-29 22:50:34 +01:00
|
|
|
{ rule = "from 10.20.30.107/32 lookup wg-clerie"; prio = 20000; }
|
2022-12-29 17:02:22 +01:00
|
|
|
{ rule = "from 10.20.30.107/32 unreachable"; prio = 20001; }
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
networking.wireguard.enable = true;
|
|
|
|
networking.wireguard.interfaces = {
|
|
|
|
wg-clerie = {
|
|
|
|
ips = [ "2a01:4f8:c0c:15f1::8107/128" "10.20.30.107/32" ];
|
2022-12-29 22:50:34 +01:00
|
|
|
table = "wg-clerie";
|
2022-12-29 17:02:22 +01:00
|
|
|
peers = [
|
|
|
|
{
|
|
|
|
endpoint = "vpn.clerie.de:51820";
|
|
|
|
persistentKeepalive = 25;
|
|
|
|
allowedIPs = [ "0.0.0.0/0" "::/0" "10.20.30.0/24" "2a01:4f8:c0c:15f1::/113" ];
|
|
|
|
publicKey = "2p1Jqs3bkXbXHFWE6vp1yxHIFoUaZQEARS2nJzbkuBA=";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
privateKeyFile = "/var/src/secrets/wireguard/wg-clerie";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-12-29 16:46:51 +01:00
|
|
|
clerie.monitoring = {
|
|
|
|
enable = true;
|
|
|
|
id = "213";
|
|
|
|
pubkey = "hMIr7fgfZwSjNufRaMtq+7MDxfwN3XLJ4ZlmSOoFrz4=";
|
2023-01-05 23:16:50 +01:00
|
|
|
serviceLevel ="event";
|
2022-12-29 16:46:51 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
system.stateVersion = "22.11";
|
|
|
|
}
|