qbit_manage: manages virtual environment with nix
This commit is contained in:
@@ -2,6 +2,31 @@
|
|||||||
let
|
let
|
||||||
port = 9091;
|
port = 9091;
|
||||||
ports = [ port 51413 ];
|
ports = [ port 51413 ];
|
||||||
|
bencodepy = pkgs.python3Packages.buildPythonPackage {
|
||||||
|
pname = "bencodepy";
|
||||||
|
version = "0.9.5";
|
||||||
|
pyproject = true;
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "eweast";
|
||||||
|
repo = "bencodepy";
|
||||||
|
rev = "a9c145bd087c61dd8fb28a9dfad46d085c8b8290";
|
||||||
|
hash = "sha256-ISiMNTrA4J8NYUQSmdVFaro1RxkSqvXhz6LpoSn/fLQ=";
|
||||||
|
fetchSubmodules = true;
|
||||||
|
};
|
||||||
|
build-system = with pkgs.python3Packages; [ setuptools ];
|
||||||
|
};
|
||||||
|
qbit_manage_env = pkgs.python3.withPackages (ps:
|
||||||
|
[
|
||||||
|
ps.croniter
|
||||||
|
ps.gitpython
|
||||||
|
ps.humanize
|
||||||
|
ps.pytimeparse2
|
||||||
|
ps.qbittorrent-api
|
||||||
|
ps.requests
|
||||||
|
ps.retrying
|
||||||
|
ps.ruamel-yaml
|
||||||
|
ps.schedule
|
||||||
|
] ++ [ bencodepy ]);
|
||||||
in {
|
in {
|
||||||
options.my.servers.qbittorrent.enable = lib.mkEnableOption "enable";
|
options.my.servers.qbittorrent.enable = lib.mkEnableOption "enable";
|
||||||
config = lib.mkIf config.my.servers.qbittorrent.enable {
|
config = lib.mkIf config.my.servers.qbittorrent.enable {
|
||||||
@@ -20,13 +45,12 @@ in {
|
|||||||
restartIfChanged = true;
|
restartIfChanged = true;
|
||||||
description = "Tidy up my torrents";
|
description = "Tidy up my torrents";
|
||||||
wantedBy = [ "default.target" ];
|
wantedBy = [ "default.target" ];
|
||||||
path = [ pkgs.python3 pkgs.pipenv ];
|
|
||||||
serviceConfig = let env = "/home/jawz/Development/Git/qbit_manage";
|
serviceConfig = let env = "/home/jawz/Development/Git/qbit_manage";
|
||||||
in {
|
in {
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
RestartSec = 30;
|
RestartSec = 30;
|
||||||
ExecStart =
|
ExecStart =
|
||||||
"${env}/venv/bin/python3 ${env}/qbit_manage.py -r -c ${env}/config.yml";
|
"${qbit_manage_env}/bin/python ${env}/qbit_manage.py -r -c ${env}/config.yml";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
unpackerr = {
|
unpackerr = {
|
||||||
|
|||||||
Reference in New Issue
Block a user