configuration.nix/hosts/wynne/network/wireguard.nix

36 lines
890 B
Nix
Raw Permalink Normal View History

2024-11-16 22:10:11 +05:30
{ config, ... }:
2024-11-17 10:28:43 +05:30
let wireguard-peers = import ../../shared/wireguard-peers.nix; in {
2024-11-16 22:10:11 +05:30
sops.secrets = {
"wireguard/wynne/pk" = {
mode = "400";
owner = config.users.users.root.name;
group = config.users.users.root.group;
};
};
networking = {
firewall = {
allowedUDPPorts = [ 51833 ];
trustedInterfaces = [ "Homelab" ];
};
wg-quick = {
interfaces = {
Homelab = {
listenPort = 51833;
privateKeyFile = config.sops.secrets."wireguard/wynne/pk".path;
address = [
2024-11-17 10:28:43 +05:30
"${config.nodeconfig.facts.wireguard-ip}/24"
2024-11-16 22:10:11 +05:30
];
dns = [ "10.10.10.11" "10.10.10.12" ];
peers = with wireguard-peers; [
(bifrost // { persistentKeepalive = 20; })
rico0
rico1
rico2
layne
];
};
};
};
};
}