Generalize and split up more files

This commit is contained in:
Jimbo 2024-11-24 20:02:09 -05:00
parent 9c03712908
commit 13d24f42ea
27 changed files with 161 additions and 156 deletions

View file

@ -0,0 +1,30 @@
{ lib, config, ... }:
{
options.system.wireguard.client.enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable the wireguard client";
};
config = lib.mkIf config.system.wireguard.client.enable {
networking = {
firewall = {
allowedUDPPorts = [ 51820 ];
trustedInterfaces = [ "wgc" ];
};
wireguard.interfaces.wgc = {
listenPort = 51820;
privateKey = config.secrets.wgClientPriv;
peers = [
{ # Cyberspark Server
publicKey = "qnOT/lXOJMaQgDUdXpyfGZB2IEyUouRje2m/bCe9ux8=";
allowedIPs = [ "10.100.0.0/24" ];
endpoint = "sv.${config.domains.jim1}:51820";
persistentKeepalive = 25;
}
];
};
};
};
}