2024-05-14 19:21:19 +02:00
|
|
|
{
|
|
|
|
pkgs,
|
2024-10-02 16:11:49 +02:00
|
|
|
nodes,
|
2024-05-14 19:21:19 +02:00
|
|
|
...
|
|
|
|
}:
|
2024-03-15 10:46:02 +01:00
|
|
|
{
|
2024-10-27 10:47:35 +01:00
|
|
|
deployment.targetHost = "manah.kat";
|
|
|
|
|
2024-05-14 19:21:19 +02:00
|
|
|
imports = [
|
|
|
|
./hardware-configuration.nix
|
|
|
|
];
|
2024-03-15 10:46:02 +01:00
|
|
|
|
2024-10-03 17:42:38 +02:00
|
|
|
boot = {
|
|
|
|
loader = {
|
|
|
|
systemd-boot.enable = true;
|
|
|
|
efi.canTouchEfiVariables = true;
|
|
|
|
};
|
|
|
|
kernel.sysctl."net.ipv4.ip_forward" = true;
|
|
|
|
kernelModules = [
|
|
|
|
"kvm-intel"
|
|
|
|
"kvm-amd"
|
|
|
|
];
|
|
|
|
};
|
2024-03-15 10:46:02 +01:00
|
|
|
|
2024-10-27 10:47:35 +01:00
|
|
|
kat = {
|
|
|
|
fqdn = "manah.katvayor.net";
|
|
|
|
proxies = {
|
|
|
|
ip = "10.42.0.1";
|
|
|
|
open-tcp = [
|
|
|
|
9000
|
|
|
|
9500
|
|
|
|
];
|
|
|
|
redirects = [
|
|
|
|
"kat-orchid"
|
|
|
|
"kat-son"
|
2024-10-28 11:15:27 +01:00
|
|
|
"kat-www"
|
2024-11-14 15:00:29 +01:00
|
|
|
"kat-degette"
|
|
|
|
"kat-betamail"
|
2024-10-27 10:47:35 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
wireguardPubKey = "2rMQV5fyBhl7t/0j70iPOfEr/lAWQfLXQKMwtzaXxnM=";
|
|
|
|
};
|
|
|
|
|
2024-10-02 16:11:49 +02:00
|
|
|
systemd.network = {
|
|
|
|
enable = true;
|
|
|
|
networks = {
|
|
|
|
"50-wg0" = {
|
|
|
|
name = "wg0";
|
2024-10-14 17:04:43 +02:00
|
|
|
address = [ "10.42.0.1/16" ];
|
2024-10-02 16:11:49 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
netdevs = {
|
|
|
|
"50-wg0" = {
|
|
|
|
netdevConfig = {
|
|
|
|
Name = "wg0";
|
|
|
|
Kind = "wireguard";
|
|
|
|
};
|
|
|
|
wireguardConfig = {
|
|
|
|
PrivateKeyFile = "/etc/wg/private.key";
|
|
|
|
};
|
|
|
|
|
|
|
|
wireguardPeers = [
|
|
|
|
{
|
|
|
|
Endpoint = "watcher.katvayor.net:1194";
|
|
|
|
AllowedIPs = [
|
|
|
|
"10.42.0.2/32"
|
|
|
|
];
|
|
|
|
PersistentKeepalive = 20;
|
|
|
|
PublicKey = nodes.kat-watcher.config.kat.wireguardPubKey;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-03-15 10:46:02 +01:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
dnsmasq
|
2024-10-03 17:42:38 +02:00
|
|
|
tcpdump
|
2024-03-15 10:46:02 +01:00
|
|
|
];
|
|
|
|
|
2024-03-20 10:07:21 +01:00
|
|
|
programs.virt-manager.enable = true;
|
2024-11-15 15:09:52 +01:00
|
|
|
virtualisation.libvirtd = {
|
|
|
|
enable = true;
|
|
|
|
qemu.vhostUserPackages = [ pkgs.virtiofsd ];
|
|
|
|
};
|
2024-03-20 10:07:21 +01:00
|
|
|
|
2024-06-19 08:34:47 +02:00
|
|
|
security.acme = {
|
|
|
|
acceptTerms = true;
|
|
|
|
defaults.email = "root@katvayor.net";
|
|
|
|
};
|
2024-03-27 17:35:34 +01:00
|
|
|
|
2024-10-27 10:47:35 +01:00
|
|
|
services = {
|
|
|
|
openssh.enable = true;
|
|
|
|
weechat = {
|
|
|
|
enable = true;
|
|
|
|
binary = "${pkgs.weechat}/bin/weechat-headless";
|
|
|
|
};
|
2024-09-23 14:10:05 +02:00
|
|
|
};
|
|
|
|
|
2024-06-18 09:47:57 +02:00
|
|
|
networking.firewall = {
|
2024-10-02 16:11:49 +02:00
|
|
|
allowedTCPPorts = [
|
|
|
|
9000
|
|
|
|
9500
|
|
|
|
53
|
|
|
|
];
|
2024-06-18 09:47:57 +02:00
|
|
|
allowedUDPPorts = [ 67 ];
|
|
|
|
};
|
2024-06-27 18:39:21 +02:00
|
|
|
system.stateVersion = "23.11";
|
2024-03-15 10:46:02 +01:00
|
|
|
}
|