2024-11-24 20:02:09 -05:00
|
|
|
{ lib, config, ... }:
|
|
|
|
{
|
|
|
|
options.system.wireguard.client.enable = lib.mkOption {
|
|
|
|
type = lib.types.bool;
|
|
|
|
default = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
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 = [
|
|
|
|
{ # Cyberspark Server
|
|
|
|
publicKey = "qnOT/lXOJMaQgDUdXpyfGZB2IEyUouRje2m/bCe9ux8=";
|
|
|
|
allowedIPs = [ "10.100.0.0/24" ];
|
2025-01-01 22:23:27 -05:00
|
|
|
endpoint = "sv.${config.domains.p1}:51820";
|
2024-11-24 20:02:09 -05:00
|
|
|
persistentKeepalive = 25;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|