modularization of all servers donion rings
This commit is contained in:
55
modules/servers/qbittorrent.nix
Normal file
55
modules/servers/qbittorrent.nix
Normal file
@@ -0,0 +1,55 @@
|
||||
{ lib, config, pkgs, proxyReverse, ... }: {
|
||||
options.my.servers.qbittorrent.enable = lib.mkEnableOption "enable";
|
||||
config = lib.mkIf config.my.servers.qbittorrent.enable {
|
||||
systemd = {
|
||||
packages = [ pkgs.qbittorrent-nox ];
|
||||
services = {
|
||||
"qbittorrent-nox@jawz" = {
|
||||
enable = true;
|
||||
overrideStrategy = "asDropin";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
};
|
||||
user = {
|
||||
services = {
|
||||
qbit_manage = {
|
||||
restartIfChanged = true;
|
||||
description = "Tidy up my torrents";
|
||||
wantedBy = [ "default.target" ];
|
||||
path = [ pkgs.python3 pkgs.pipenv ];
|
||||
serviceConfig = {
|
||||
Restart = "on-failure";
|
||||
RestartSec = 30;
|
||||
WorkingDirectory = "/home/jawz/Development/Git/qbit_manage";
|
||||
ExecStart =
|
||||
"./venv/bin/python3 ./qbit_manage.py -r -c ./config.yml";
|
||||
};
|
||||
};
|
||||
unpackerr = {
|
||||
enable = false;
|
||||
restartIfChanged = true;
|
||||
description = "Run unpackerr";
|
||||
wantedBy = [ "default.target" ];
|
||||
serviceConfig = {
|
||||
Restart = "on-failure";
|
||||
RestartSec = 30;
|
||||
ExecStart =
|
||||
"${pkgs.unpackerr}/bin/unpackerr -c /home/jawz/.config/unpackerr.conf";
|
||||
};
|
||||
};
|
||||
};
|
||||
timers.qbit_manage = {
|
||||
enable = true;
|
||||
description = "Tidy up my torrents";
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = { OnCalendar = "*:0/10"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts."xfwmrle6h6skqujbeizw.${config.my.domain}" =
|
||||
proxyReverse 9091 // { };
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user