From 06d8b381c49b11dcc9e20602916fe76ada7b62d9 Mon Sep 17 00:00:00 2001 From: Magic_RB Date: Wed, 28 Jun 2023 14:46:24 +0200 Subject: [PATCH] Remove udp2tcp Signed-off-by: Magic_RB --- nixos/systems/omen/default.nix | 1 - nixos/systems/omen/udp2tcp.nix | 110 --------------------------------- 2 files changed, 111 deletions(-) delete mode 100644 nixos/systems/omen/udp2tcp.nix diff --git a/nixos/systems/omen/default.nix b/nixos/systems/omen/default.nix index 703c246..d85aa63 100644 --- a/nixos/systems/omen/default.nix +++ b/nixos/systems/omen/default.nix @@ -27,7 +27,6 @@ in { imports = [ ./xserver.nix - ./udp2tcp.nix ../../common/steam.nix ./grub.nix ./networking.nix diff --git a/nixos/systems/omen/udp2tcp.nix b/nixos/systems/omen/udp2tcp.nix deleted file mode 100644 index 995d397..0000000 --- a/nixos/systems/omen/udp2tcp.nix +++ /dev/null @@ -1,110 +0,0 @@ -{ pkgs, lib, ... }: -let - inherit (lib) - makeBinPath; -in -{ - systemd.services.udp2tcp = { - 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 \ - --tcp-forward "64.225.104.221:6001" - ''; - }; - - 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 restart udp2tcp.service - ''; - }; - - networking.networkmanager.dispatcherScripts = [ - { - source = pkgs.writeShellScript "udp2tcp.sh" - '' - export PATH=${makeBinPath [ pkgs.wireguard-tools ]}:$PATH - _interface="$1" - _action="$2" - - echo "action: $_action interface: $_interface id: $CONNECTION_ID" - case "$_action" in - up) - case "$_interface" in - wlo1) - case "$CONNECTION_ID" in - VU-Campusnet) - wg set wg0 \ - peer h4g6vWjOB6RS0NbrP/Kvb2CZeutm/F+ZfDbJmEd1Dgk= \ - endpoint 127.0.0.1:6665 - systemctl restart udp2tcp.service - ;; - *) - wg set wg0 \ - peer h4g6vWjOB6RS0NbrP/Kvb2CZeutm/F+ZfDbJmEd1Dgk= \ - endpoint 64.225.104.221:6666 - systemctl stop udp2tcp.service - ;; - esac - ;; - *) - ;; - esac - ;; - down) - wg set wg0 \ - peer h4g6vWjOB6RS0NbrP/Kvb2CZeutm/F+ZfDbJmEd1Dgk= \ - endpoint 64.225.104.221:6666 - systemctl stop udp2tcp.service - ;; - *) - ;; - esac - ''; - } - { - source = pkgs.writeShellScript "nfs-mounts.sh" - '' - export PATH=${makeBinPath [ pkgs.iputils ]}:$PATH - - ping -c 1 -W 0.7 8.8.4.4 # > /dev/null 2>&1 - - if [ $? -eq 0 ] ; then - echo "Mounting network drives" - systemctl start mnt-net-kyle.mount \ - mnt-net-cartman.mount \ - mnt-net-stan.mount \ - mnt-net-getmail.d.mount \ - mnt-net-mail\\x2dconfiguration & - else - echo "Unmounting network drives" - umount -ql \ - /mnt/net/kyle \ - /mnt/net/cartman \ - /mnt/net/stan \ - /mnt/net/getmail.d \ - /mnt/net/mail-configuration & - fi - ''; - } - ]; -}