From 89947435e1a751748dcd04b431e5b2f655cd4caf Mon Sep 17 00:00:00 2001 From: Veneficium <85629831+veneficium42@users.noreply.github.com> Date: Tue, 24 Dec 2024 14:41:06 +0100 Subject: [PATCH] containers: add qbittorent --- containers/default.nix | 13 ++++++++++ containers/qbittorrent.nix | 36 ++++++++++++++++++++++++++++ hosts/main-homelab/configuration.nix | 5 ++-- 3 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 containers/default.nix create mode 100644 containers/qbittorrent.nix diff --git a/containers/default.nix b/containers/default.nix new file mode 100644 index 0000000..d1c656b --- /dev/null +++ b/containers/default.nix @@ -0,0 +1,13 @@ +{ lib, ... }: +{ + imports = [ + "./jellyfin.nix" + "./qbittorent.nix" + ]; + + settings.containers = { + jellyfin.enable = lib.mkDefault false; + qbittorent.enable = lib.mkDefault false; + }; + +} diff --git a/containers/qbittorrent.nix b/containers/qbittorrent.nix new file mode 100644 index 0000000..929f18f --- /dev/null +++ b/containers/qbittorrent.nix @@ -0,0 +1,36 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + options.settings.containers.qbittorent = { + enable = lib.mkEnableOption "enable qbittorent arion container"; + }; + + config = lib.mkIf config.settings.containers.qbittorent.enable { + virtualisation.arion.projects.qbittorent = { + settings = { + project.name = "qbittorent"; + services.qbittorent = { + service.useHostStore = true; + service.image = "linuxserver/qbittorrent:latest"; + service.ports = [ + "8080:8080" + "6881:6881" + "6881:6881/udp" + ]; + service.volumes = [ + "/config/qbittorent:/config" + "/data/torrents:/torrents" + ]; + service.environment = { + WEBUI_PORT = 8080; + TORRENTING_PORT = 6881; + }; + }; + }; + }; + }; +} diff --git a/hosts/main-homelab/configuration.nix b/hosts/main-homelab/configuration.nix index 90266ba..ec04ae9 100644 --- a/hosts/main-homelab/configuration.nix +++ b/hosts/main-homelab/configuration.nix @@ -7,10 +7,9 @@ { imports = [ - # Include the results of the hardware scan. ./hardware-configuration.nix ../../modules/nixos - ../../containers/jellyfin.nix + ../../containers ]; settings = { @@ -29,7 +28,7 @@ openssh.usePAM = lib.mkForce true; }; - containers.jellyfin.enable = true; + containers.jellyfin.enable = lib.mkForce true; }; boot.kernelPackages = pkgs.linuxPackages_latest;