feat(heimdall+desktop): setup wireguard tunnel.
This commit is contained in:
parent
be539374c0
commit
5fa7edbc18
10 changed files with 63 additions and 13 deletions
|
@ -2,5 +2,7 @@
|
|||
imports = [
|
||||
./uptime-kuma.nix
|
||||
./ntfy-sh.nix
|
||||
./wireguard.nix
|
||||
./secrets.nix
|
||||
];
|
||||
}
|
||||
|
|
9
modules/servers/heimdall/secrets.nix
Normal file
9
modules/servers/heimdall/secrets.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
age = {
|
||||
secrets = {
|
||||
wg-heimdall = {
|
||||
file = ../../../secrets/wg-heimdall.age;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
24
modules/servers/heimdall/wireguard.nix
Normal file
24
modules/servers/heimdall/wireguard.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{config, ...}: {
|
||||
networking = {
|
||||
nat = {
|
||||
enable = true;
|
||||
enableIPv6 = true;
|
||||
externalInterface = "enp1s0";
|
||||
internalInterfaces = ["wg0"];
|
||||
};
|
||||
firewall = {
|
||||
allowedTCPPorts = [53];
|
||||
allowedUDPPorts = [53 51820];
|
||||
};
|
||||
wg-quick.interfaces.wg0.configFile = "${config.age.secrets.wg-heimdall.path}";
|
||||
};
|
||||
|
||||
services.dnsmasq = {
|
||||
enable = true;
|
||||
settings = {
|
||||
interface = "wg0";
|
||||
};
|
||||
};
|
||||
|
||||
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue