From 7ecbeb6c983ae9261976f8d113da314e76c98824 Mon Sep 17 00:00:00 2001 From: main Date: Fri, 2 Dec 2022 18:58:03 +0100 Subject: [PATCH] Improvements to UDP blockade bypass Signed-off-by: main --- nixos/systems/omen.nix | 15 +++++++++++++-- nixos/systems/toothpick/u2t.nix | 6 ++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/nixos/systems/omen.nix b/nixos/systems/omen.nix index 45cb260..7f0e9fd 100644 --- a/nixos/systems/omen.nix +++ b/nixos/systems/omen.nix @@ -86,11 +86,13 @@ }; systemd.services.udp2tcp = { - wantedBy = [ "mutli-user.target" ]; - wants = [ "network-online.target" ]; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; path = with pkgs; [ dig.host ]; + restartIfChanged = true; + script = '' ${pkgs.udp-over-tcp}/bin/udp2tcp\ --udp-listen 127.0.0.1:6665 \ @@ -98,6 +100,15 @@ ''; }; + systemd.services.udp2tcp-wake-restart = { + wantedBy = [ "suspend.target" "hibernate.target" "hybrid-sleep.target" "suspend-then-hibernate.target" ]; + after = [ "suspend.target" "hibernate.target" "hybrid-sleep.target" "suspend-then-hibernate.target" ]; + + script = '' + systemctl restrart udp2tcp.services + ''; + }; + # System system.stateVersion = "20.09"; }; diff --git a/nixos/systems/toothpick/u2t.nix b/nixos/systems/toothpick/u2t.nix index 22c8d08..26a8869 100644 --- a/nixos/systems/toothpick/u2t.nix +++ b/nixos/systems/toothpick/u2t.nix @@ -1,8 +1,10 @@ { pkgs, ... }: { systemd.services.udp2tcp = { - wantedBy = [ "mutli-user.target" ]; - wants = [ "network-online.target" ]; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; + + restartIfChanged = true; path = with pkgs; [ dig.host ];