feat(heimdall+desktop): setup wireguard tunnel.

This commit is contained in:
CronyAkatsuki 2025-05-04 18:11:15 +02:00
parent be539374c0
commit 5fa7edbc18
10 changed files with 63 additions and 13 deletions

View file

@ -23,6 +23,7 @@
./sunshine.nix
./nh.nix
./ollama.nix
./secrets.nix
];
crony.bluetooth.enable = lib.mkDefault true;

View file

@ -0,0 +1,10 @@
{
age = {
secrets = {
wg-desktop = {
file = ../../../secrets/wg-desktop.age;
};
};
identityPaths = ["/home/crony/.ssh/main"];
};
}

View file

@ -8,19 +8,10 @@
};
config = lib.mkIf config.crony.wireguard.enable {
# Allow for wireguard traffic
networking.firewall = {
# if packets are still dropped, they will show up in dmesg
logReversePathDrops = true;
# wireguard trips rpfilter up
extraCommands = ''
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN
'';
extraStopCommands = ''
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN || true
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN || true
'';
# Setup wireguard
networking.wg-quick.interfaces.wg0 = {
autostart = false;
configFile = "${config.age.secrets.wg-desktop.path}";
};
};
}