From d466d4091a49bd4f2266962bb237eb10b9438a40 Mon Sep 17 00:00:00 2001 From: Danilo Reyes Date: Sat, 31 May 2025 17:32:04 -0600 Subject: [PATCH] somewhat declaratively install vuetorrent --- modules/servers/qbittorrent.nix | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/modules/servers/qbittorrent.nix b/modules/servers/qbittorrent.nix index bfb8643..e911e90 100644 --- a/modules/servers/qbittorrent.nix +++ b/modules/servers/qbittorrent.nix @@ -10,7 +10,12 @@ let system = "x86_64-linux"; config.allowUnfree = true; }; - qbit_manage_env = pkgs.python3.withPackages ( + vuetorrent = pkgs.fetchzip { + url = "https://github.com/VueTorrent/VueTorrent/releases/download/v2.25.0/vuetorrent.zip"; + sha256 = "sha256-sOaQNw6AnpwNFEextgTnsjEOfpl3/lpoOZFgFOz7Bos="; + stripRoot = true; + }; + qbit_manageEnv = pkgs.python3.withPackages ( ps: builtins.attrValues { inherit (ps) @@ -41,9 +46,15 @@ in }; }; config = lib.mkIf config.my.servers.qbittorrent.enable { - home-manager.users.jawz.xdg.configFile."unpackerr.conf" = - lib.mkIf config.my.servers.unpackerr.enable - { source = ../../dotfiles/unpackerr.conf; }; + home-manager.users.jawz = { + home.activation.installVueTorrent = lib.mkAfter '' + mkdir -p "$HOME/.config/vuetorrent" + cp -rT "${vuetorrent}" "$HOME/.local/share/vuetorrent" + ''; + xdg.configFile."unpackerr.conf" = lib.mkIf config.my.servers.unpackerr.enable { + source = ../../dotfiles/unpackerr.conf; + }; + }; sops.secrets = let mkQbitSecret = file: mode: { @@ -80,7 +91,7 @@ in { Restart = "on-failure"; RestartSec = 30; - ExecStart = "${qbit_manage_env}/bin/python ${env}/qbit_manage.py -r -c ${env}/config.yml"; + ExecStart = "${qbit_manageEnv}/bin/python ${env}/qbit_manage.py -r -c ${env}/config.yml"; }; }; unpackerr = lib.mkIf config.my.servers.unpackerr.enable {