all: use wg-quick for wireguard

This commit is contained in:
Adithya 2024-10-25 22:59:09 +05:30
parent 8318f75fcf
commit b735c09e57
Signed by: adtya
GPG key ID: B8857BFBA2C47B9C
2 changed files with 4 additions and 4 deletions

View file

@ -1,5 +1,6 @@
_: {
nodeconfig.wireguard = {
interface-name = "Homelab";
endpoint = "165.232.180.97:51821";
endpoint-publickey = "NNw/iDMCTq8mpHncrecEh4UlvtINX/UUDtCJf2ToFR4=";
allowed-ips = [

View file

@ -52,16 +52,15 @@ let cfg = config.nodeconfig; in {
config = lib.mkIf cfg.wireguard.enable {
networking.firewall.trustedInterfaces = [ cfg.wireguard.interface-name ];
networking.wireguard = {
enable = true;
networking.wg-quick = {
interfaces = {
"${cfg.wireguard.interface-name}" = {
ips = cfg.wireguard.node-ips;
address = cfg.wireguard.node-ips;
dns = [ "10.10.10.10" ];
listenPort = cfg.wireguard.listen-port;
privateKeyFile = cfg.wireguard.pk-file;
peers = [
{
name = "Default";
endpoint = cfg.wireguard.endpoint;
publicKey = cfg.wireguard.endpoint-publickey;
presharedKeyFile = cfg.wireguard.psk-file;