diff --git a/systems/mottarone/default.nix b/systems/mottarone/default.nix index ff8459a..46fabc5 100644 --- a/systems/mottarone/default.nix +++ b/systems/mottarone/default.nix @@ -40,7 +40,20 @@ ''; }; - networking.firewall.allowedTCPPorts = [ 8000 ]; + networking = { + firewall.allowedTCPPorts = [ 8000 ]; + networkmanager.dispatcherScripts = [ + { + type = "basic"; + source = pkgs.writeShellScript "vpnUpHook" '' + if [ "$2" == "vpn-up" ]; then + resolvectl default-route tun0 true + logger "Set default-route to tun0" + fi + ''; + } + ]; + }; services = { resolved = {