From aea3ae3f67e6546bb32fe3794c2de1d99223cdfd Mon Sep 17 00:00:00 2001 From: oqyude Date: Tue, 16 Sep 2025 20:40:57 +0300 Subject: [PATCH] 123 --- nixosModules/primary/default.nix | 1 - nixosModules/services/zapret.nix | 84 ++++++++++++++++---------------- 2 files changed, 43 insertions(+), 42 deletions(-) diff --git a/nixosModules/primary/default.nix b/nixosModules/primary/default.nix index 73aa2d1..e343ffa 100755 --- a/nixosModules/primary/default.nix +++ b/nixosModules/primary/default.nix @@ -5,6 +5,5 @@ { imports = [ ../desktop - ../services/zapret.nix ]; } diff --git a/nixosModules/services/zapret.nix b/nixosModules/services/zapret.nix index 4fb7f13..6ca32fd 100644 --- a/nixosModules/services/zapret.nix +++ b/nixosModules/services/zapret.nix @@ -5,48 +5,50 @@ ... }: { - services.zapret = { - enable = true; - params = [ - "--dpi-desync=fake,disorder2" - "--dpi-desync-ttl=1" - "--dpi-desync-autottl=2" - ]; - }; - # systemd.services.zapret = { + # services.zapret = { # enable = true; - # after = [ "network.target" ]; - # wantedBy = [ "multi-user.target" ]; - # description = "Custom Script Service"; - # path = with pkgs; [ - # sudo - # git - # nftables - # iproute2 - # coreutils + # params = [ + # "--dpi-desync=fake,disorder2" + # "--dpi-desync-ttl=1" + # "--dpi-desync-autottl=2" # ]; - # unitConfig = { - # After = [ "network-online.target" ]; - # Wants = [ "network-online.target" ]; - # }; - # serviceConfig = { - # Type = "simple"; - # WorkingDirectory = "${xlib.dirs.user-services}/zapret"; - # User = "root"; - # ExecStart = '' - # /run/current-system/sw/bin/bash ${xlib.dirs.user-services}/zapret/main_script.sh -nointeractive - # ''; - # ExecStop = '' - # /run/current-system/sw/bin/bash ${xlib.dirs.user-services}/zapret/stop_and_clean_nft.sh - # ''; - # # ExecStopPost = '' - # # /run/current-system/sw/bin/echo "Сервис завершён" - # # ''; - # PIDFile = '' - # /run/zapret_discord_youtube.pid - # ''; - # # Restart = "on-failure"; - # # RestartSec = "5s"; - # }; # }; + + systemd.services.zapret = { + enable = true; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + description = "Custom Script Service"; + path = with pkgs; [ + sudo + git + nftables + iproute2 + zapret + coreutils + ]; + unitConfig = { + After = [ "network-online.target" ]; + Wants = [ "network-online.target" ]; + }; + serviceConfig = { + Type = "simple"; + WorkingDirectory = "${xlib.dirs.user-services}/zapret"; + User = "root"; + ExecStart = '' + /run/current-system/sw/bin/bash ${xlib.dirs.user-services}/zapret/main_script.sh -nointeractive + ''; + ExecStop = '' + /run/current-system/sw/bin/bash ${xlib.dirs.user-services}/zapret/stop_and_clean_nft.sh + ''; + # ExecStopPost = '' + # /run/current-system/sw/bin/echo "Сервис завершён" + # ''; + PIDFile = '' + /run/zapret_discord_youtube.pid + ''; + # Restart = "on-failure"; + # RestartSec = "5s"; + }; + }; }