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;