2023-04-04 21:01:44 +02:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
imports =
|
|
|
|
[
|
|
|
|
./hardware-configuration.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
boot.kernelParams = [ "console=ttyS0,115200n8" ];
|
|
|
|
|
|
|
|
# Use the GRUB 2 boot loader.
|
|
|
|
boot.loader.grub.enable = true;
|
|
|
|
boot.loader.grub.version = 2;
|
|
|
|
# boot.loader.grub.efiSupport = true;
|
|
|
|
# boot.loader.grub.efiInstallAsRemovable = true;
|
|
|
|
# boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
|
|
|
# Define on which hard drive you want to install Grub.
|
|
|
|
boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
|
|
|
|
boot.loader.grub.extraConfig = "
|
|
|
|
serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1
|
|
|
|
terminal_input serial
|
|
|
|
terminal_output serial
|
|
|
|
";
|
|
|
|
|
|
|
|
networking.hostName = "astatine";
|
|
|
|
|
2023-04-04 21:30:56 +02:00
|
|
|
networking.firewall.enable = false;
|
|
|
|
|
|
|
|
networking.iproute2.enable = true;
|
|
|
|
networking.iproute2.rttablesExtraConfig = ''
|
|
|
|
200 wg-clerie
|
|
|
|
'';
|
|
|
|
|
|
|
|
petabyte.policyrouting = {
|
|
|
|
enable = true;
|
|
|
|
rules6 = [
|
|
|
|
{ rule = "from 2a01:4f8:c0c:15f1::8108/128 lookup wg-clerie"; prio = 20000; }
|
|
|
|
{ rule = "from 2a01:4f8:c0c:15f1::8108/128 unreachable"; prio = 20001; }
|
|
|
|
];
|
|
|
|
rules4 = [
|
|
|
|
{ rule = "from 10.20.30.108/32 lookup wg-clerie"; prio = 20000; }
|
|
|
|
{ rule = "from 10.20.30.108/32 unreachable"; prio = 20001; }
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
networking.wireguard.enable = true;
|
|
|
|
networking.wireguard.interfaces = {
|
|
|
|
wg-clerie = {
|
|
|
|
ips = [ "2a01:4f8:c0c:15f1::8108/128" "10.20.30.108/32" ];
|
|
|
|
table = "wg-clerie";
|
|
|
|
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";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-04-04 21:01:44 +02:00
|
|
|
clerie.monitoring = {
|
2023-04-04 22:16:08 +02:00
|
|
|
enable = true;
|
|
|
|
id = "214";
|
|
|
|
pubkey = "I4xh3t6vIcNyntZkewXX56eWrEd3J0hhaYV45xj6uVU=";
|
|
|
|
serviceLevel = "event";
|
2023-04-04 21:01:44 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
system.stateVersion = "23.05";
|
|
|
|
}
|
|
|
|
|