This commit is contained in:
pazpi 2024-07-15 23:03:00 +02:00
parent 4300ddacb0
commit b80563f0ed
No known key found for this signature in database
GPG key ID: 0942571C4B9966BE
10 changed files with 755 additions and 1 deletions

View file

@ -0,0 +1,29 @@
# qBittorrent service activation
#
# The shell script 'fixdlperms' is also created and should be added to the
# "Run external program on finished" section with the full path:
# /run/current-system/sw/bin/fixdlperms
{ pkgs, ... }:
let
downloadDir = "/data/multimedia/downloads";
fixDownloadPerms = pkgs.writeShellScriptBin "fixdlperms" ''
find ${downloadDir} -type d -exec chmod 2775 {} +
find ${downloadDir} -type f -exec chmod 0664 {} +
'';
in
{
services.qbittorrent = {
enable = true;
openFirewall = true;
dataDir = "/srv/qbittorrent";
port = 58080;
user = "qbittorrent";
};
# Allow qbittorrent to save files in the multimedia share
# users.users.qbittorrent.extraGroups = [ "multimedia" ];
environment.systemPackages = [ fixDownloadPerms ];
}