qBittorrent headless service module

Just thought I’d share my qbittorrent headless service module in case it helps someone here.

Once you import the module, you can enable it as you would most other common service modules. For example:

  services.qbittorrent = {
    enable = true;
    openFirewall = true;
    port = 58080;
  };

I’m not sure what it would take to get it upstream, but I might look into that when I have a bit more time.

5 Likes

Thanks for this! I copied the module into my config without any changes but it’s not working for me.

configuration.nix:

services.qbittorrent = {
  enable = true;
  user = "media";
  group = "media";
  port = 8728;
};

users.users.media = {
  group = "media";
  isSystemUser = true;
  uid = 1001;
};
users.groups.media = { gid = 1001; };

journalctl -feu qbittorrent:

Dec 08 13:23:58 blizzard systemd[1]: Starting qBittorrent-nox service...
Dec 08 13:23:58 blizzard systemd[1]: Started qBittorrent-nox service.
Dec 08 13:23:58 blizzard qbittorrent-nox[32605]: Could not create required directory '/var/lib/qbittorrent/qBittorrent/cache'
Dec 08 13:23:58 blizzard systemd[1]: qbittorrent.service: Main process exited, code=dumped, status=6/ABRT
Dec 08 13:23:58 blizzard systemd[1]: qbittorrent.service: Failed with result 'core-dump'.

It looks like a permission issue. I tried a few things such as creating the directory manually & setting the owner, setting dataDir to somewhere else, to using the default user & group in the module, but no luck.

Any help would be appreciated!

1 Like

Really awesome script.
Was confused through the floor on why the hell I couldn’t log in. Turn out it’s a bug specific to 4.6.1, seemingly fixed in 4.6.2. That version killed the default password, but has a bugged generation of the new password: https://www.reddit.com/r/qBittorrent/comments/1827zqn/comment/kahat1u/?utm_source=share&utm_medium=web2x&context=3

Solution whitelist subnet login, login through a remote console, access localhost and change the password.
The generated password did appear in the logs, but only once and was not applied for whatever reason. Subsequent service restarts did not lead to new ones being generated.