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 ];