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 = {
|
2024-12-22 00:22:52 -05:00
|
|
|
firewall.trustedInterfaces = [ "wgc" ];
|
|
|
|
wg-quick.interfaces.wgc = {
|
2024-11-24 20:02:09 -05:00
|
|
|
privateKey = config.secrets.wgClientPriv;
|
|
|
|
peers = [
|
2025-01-02 10:01:11 -05:00
|
|
|
{ # Kitty server
|
2024-11-24 20:02:09 -05:00
|
|
|
publicKey = "qnOT/lXOJMaQgDUdXpyfGZB2IEyUouRje2m/bCe9ux8=";
|
|
|
|
allowedIPs = [ "10.100.0.0/24" ];
|
2025-01-02 10:01:11 -05:00
|
|
|
endpoint = "sv.${config.domains.p2}:51820";
|
2024-11-24 20:02:09 -05:00
|
|
|
persistentKeepalive = 25;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|