modularization of all servers donion rings

This commit is contained in:
2024-06-15 00:27:14 -06:00
parent add0490415
commit fbf81f60ce
22 changed files with 618 additions and 521 deletions

View 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 // { };
};
};
}