Files
nixos/nixosModules/services/zapret.nix
T
2025-09-16 19:49:55 +03:00

42 lines
983 B
Nix
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
config,
pkgs,
xlib,
...
}:
{
systemd.services.zapret = {
enable = true;
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
description = "Custom Script Service";
path = with pkgs; [
sudo
git
nftables
iproute2
coreutils
];
serviceConfig = {
Type = "simple";
WorkingDirectory = "${xlib.dirs.user-services}/Misc/Devices/Services/zapret/137";
User = "root";
ExecStart = ''
${pkgs.bash}/bin/bash ${xlib.dirs.user-services}/Misc/Devices/Services/zapret/main_script.sh -nointeractive
'';
ExecStop = ''
${pkgs.bash}/bin/bash ${xlib.dirs.user-services}/Misc/Devices/Services/zapret/stop_and_clean_nft.sh
'';
ExecStopPost = ''
${pkgs.coreutils}/bin/echo "Сервис завершён"
'';
PIDFile = ''
/run/zapret_discord_youtube.pid
'';
Restart = "on-failure";
RestartSec = "5s";
};
};
}