Update Wireguard client also

This commit is contained in:
Bun 2025-04-16 22:14:31 -04:00
parent 08827b5d5d
commit 48a2e3211d
12 changed files with 128 additions and 110 deletions

View file

@ -12,5 +12,6 @@
./sunshine
./tlp
./userborn
./wireguard
];
}

View file

@ -0,0 +1,28 @@
{ config, lib, pkgs, ... }:
{
options.services.wg.client.enable = lib.mkEnableOption "Enable Wireguard client";
config = lib.mkIf config.services.wg.client.enable {
boot.kernelModules = [ "wireguard" ];
systemd.network = {
netdevs = {
"10-wg0" = {
netdevConfig = {
Kind = "wireguard";
Name = "wg0";
MTUBytes = "1300";
};
wireguardConfig = {
PrivateKeyFile = pkgs.writeText "wgclientsecret" config.secrets.wg.clientKey;
ListenPort = 9918;
};
};
};
networks."wg0" = {
matchConfig.Name = "wg0";
DHCP = "no";
};
};
};
}