ookflix: refactors FIX COMMIT
This commit is contained in:
parent
da77c223ff
commit
c096dc295a
10 changed files with 154 additions and 138 deletions
46
modules/nixos/server/services/ookflix/qbittorrent.nix
Normal file
46
modules/nixos/server/services/ookflix/qbittorrent.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
ook,
|
||||
self,
|
||||
...
|
||||
}: let
|
||||
ookflixLib = import ./lib.nix {inherit lib config self;};
|
||||
inherit (ookflixLib) mkServiceUser mkServiceStateDir;
|
||||
inherit (lib) mkIf;
|
||||
inherit (ook.lib.container) mkContainerLabel mkContainerEnvironment;
|
||||
inherit (config.ooknet.server.ookflix) groups volumes;
|
||||
inherit (config.ooknet.server.ookflix.services) qbittorrent;
|
||||
in {
|
||||
config = mkIf qbittorrent.enable {
|
||||
users = mkServiceUser qbittorrent.user.name;
|
||||
systemd.tmpfiles = mkServiceStateDir "qbittorrent" qbittorrent.stateDir;
|
||||
virtualisation.oci-containers.containers = {
|
||||
# Torrent client
|
||||
qbittorrent = {
|
||||
image = "ghcr.io/hotio/qbittorrent";
|
||||
dependsOn = ["gluetun"];
|
||||
volumes = [
|
||||
"${qbittorrent.stateDir}:/config"
|
||||
"${volumes.torrents.root}:/data/torrents"
|
||||
];
|
||||
extraOptions = ["--network=container:gluetun"];
|
||||
labels = mkContainerLabel {
|
||||
name = "qbittorrent";
|
||||
inherit (qbittorrent) port domain;
|
||||
homepage = {
|
||||
group = "downloads";
|
||||
description = "torrent client";
|
||||
};
|
||||
};
|
||||
environment =
|
||||
mkContainerEnvironment qbittorrent.user.id groups.downloads.id
|
||||
// {
|
||||
UMASK = "002";
|
||||
WEBUI_PORTS = "${toString qbittorrent.port}/tcp,${toString qbittorrent.port}/udp";
|
||||
TORRENTING_PORT = "${toString qbittorrent.torrentPort}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue