refactor
This commit is contained in:
parent
dbd88aea66
commit
8fbd9d06b4
29 changed files with 130 additions and 101 deletions
25
host/roam/modules/wireguard.nix
Normal file
25
host/roam/modules/wireguard.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ ... }:
|
||||
let
|
||||
wireguard-port = 51820;
|
||||
wireguard-subnet = "100.10.11.0/24";
|
||||
in
|
||||
{
|
||||
networking = {
|
||||
nat = {
|
||||
enable = true;
|
||||
externalInterface = "ens3";
|
||||
internalInterfaces = [ "wg0" ];
|
||||
};
|
||||
|
||||
firewall.allowedUDPPorts = [ wireguard-port ];
|
||||
|
||||
wireguard = {
|
||||
enable = true;
|
||||
interfaces."wg0" = {
|
||||
ips = [ wireguard-subnet ];
|
||||
listenPort = wireguard-port;
|
||||
privateKeyFile = "/var/secrets/wg0.key";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue