configuration.nix/hosts/rico2/network/wireguard.nix

36 lines
875 B
Nix
Raw Normal View History

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