nixos-config/modules/system/devices/networking/wireguard/client/default.nix

22 lines
630 B
Nix
Raw Permalink Normal View History

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