nixos-config/modules/system/devices/networking/wireguard/client/default.nix
2025-02-02 13:42:37 -05:00

22 lines
630 B
Nix

{ config, lib, ... }:
{
options.system.wireguard.client.enable = lib.mkEnableOption "Enable the Wireguard client";
config = lib.mkIf config.system.wireguard.client.enable {
networking = {
firewall.trustedInterfaces = [ "wgc" ];
wg-quick.interfaces.wgc = {
privateKey = config.secrets.wgClientPriv;
peers = [
{ # Kitty server
publicKey = "qnOT/lXOJMaQgDUdXpyfGZB2IEyUouRje2m/bCe9ux8=";
allowedIPs = [ "10.100.0.0/24" ];
endpoint = "sv.${config.domains.p2}:51820";
persistentKeepalive = 25;
}
];
};
};
};
}