qbit_manage: manages virtual environment with nix
This commit is contained in:
@@ -2,6 +2,31 @@
|
||||
let
|
||||
port = 9091;
|
||||
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 {
|
||||
options.my.servers.qbittorrent.enable = lib.mkEnableOption "enable";
|
||||
config = lib.mkIf config.my.servers.qbittorrent.enable {
|
||||
@@ -20,13 +45,12 @@ in {
|
||||
restartIfChanged = true;
|
||||
description = "Tidy up my torrents";
|
||||
wantedBy = [ "default.target" ];
|
||||
path = [ pkgs.python3 pkgs.pipenv ];
|
||||
serviceConfig = let env = "/home/jawz/Development/Git/qbit_manage";
|
||||
in {
|
||||
Restart = "on-failure";
|
||||
RestartSec = 30;
|
||||
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 = {
|
||||
|
||||
Reference in New Issue
Block a user