ookflix: segment modules
This commit is contained in:
parent
4edb21607c
commit
bee284691a
21 changed files with 314 additions and 100 deletions
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
imports = [
|
||||
./sonarr.nix
|
||||
./radarr.nix
|
||||
./prowlarr.nix
|
||||
./jellyseer.nix
|
||||
./qbittorrent.nix
|
||||
];
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
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 mkContainerPort;
|
||||
inherit (config.ooknet.server.ookflix) groups;
|
||||
inherit (config.ooknet.server.ookflix.services) jellyseerr;
|
||||
in {
|
||||
config = mkIf jellyseerr.enable {
|
||||
# media requesting for jellyfin
|
||||
users = mkServiceUser jellyseerr.user.name;
|
||||
systemd.tmpfiles.settings.jellyseerrStateDir = mkServiceStateDir "jellyseerr";
|
||||
virtualisation.oci-containers.containers = {
|
||||
jellyseerr = {
|
||||
image = "ghcr.io/hotio/jellyseerr";
|
||||
autoStart = true;
|
||||
hostname = "jellyseerr";
|
||||
ports = [(mkContainerPort jellyseerr.port)];
|
||||
volumes = ["${jellyseerr.stateDir}:/config"];
|
||||
labels = mkContainerLabel {
|
||||
name = "jellyseerr";
|
||||
inherit (jellyseerr) domain port;
|
||||
homepage = {
|
||||
group = "media";
|
||||
description = "media-server requesting";
|
||||
};
|
||||
};
|
||||
environment = mkContainerEnvironment jellyseerr.user.id groups.media.id;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
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 mkContainerPort;
|
||||
inherit (config.ooknet.server.ookflix) groups;
|
||||
inherit (config.ooknet.server.ookflix.services) prowlarr;
|
||||
in {
|
||||
config = mkIf prowlarr.enable {
|
||||
users = mkServiceUser prowlarr.user.name;
|
||||
systemd.tmpfiles.settings.prowlarrStateDir = mkServiceStateDir "prowlarr";
|
||||
virtualisation.oci-containers.containers = {
|
||||
prowlarr = {
|
||||
image = "lscr.io/linuxserver/prowlarr:latest";
|
||||
autoStart = true;
|
||||
hostname = "prowlarr";
|
||||
ports = [(mkContainerPort prowlarr.port)];
|
||||
volumes = ["${prowlarr.stateDir}:/config"];
|
||||
labels = mkContainerLabel {
|
||||
name = "prowlarr";
|
||||
inherit (prowlarr) port domain;
|
||||
homepage = {
|
||||
group = "arr";
|
||||
description = "media-server indexer";
|
||||
};
|
||||
};
|
||||
environment =
|
||||
mkContainerEnvironment prowlarr.user.id groups.media.id
|
||||
// {
|
||||
UMASK = "002";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
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.settings.qbittorrentStateDir = mkServiceStateDir "qbittorrent";
|
||||
virtualisation.oci-containers.containers = {
|
||||
# Torrent client
|
||||
qbittorrent = {
|
||||
hostname = "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.media.id
|
||||
// {
|
||||
UMASK = "002";
|
||||
WEBUI_PORTS = "${toString qbittorrent.port}/tcp,${toString qbittorrent.port}/udp";
|
||||
TORRENTING_PORT = "${toString qbittorrent.torrentPort}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
44
modules/nixos/server/services/ookflix/downloading/radarr.nix
Normal file
44
modules/nixos/server/services/ookflix/downloading/radarr.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
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 mkContainerPort mkContainerEnvironment;
|
||||
inherit (config.ooknet.server.ookflix) groups volumes;
|
||||
inherit (config.ooknet.server.ookflix.services) radarr;
|
||||
in {
|
||||
config = mkIf radarr.enable {
|
||||
users = mkServiceUser radarr.user.name;
|
||||
systemd.tmpfiles.settings.radarrStateDir = mkServiceStateDir "radarr";
|
||||
virtualisation.oci-containers.containers = {
|
||||
radarr = {
|
||||
image = "ghcr.io/hotio/radarr";
|
||||
autoStart = true;
|
||||
hostname = "radarr";
|
||||
ports = [(mkContainerPort radarr.port)];
|
||||
volumes = [
|
||||
"${radarr.stateDir}:/config"
|
||||
"${volumes.data.root}:/data"
|
||||
];
|
||||
labels = mkContainerLabel {
|
||||
name = "radarr";
|
||||
inherit (radarr) port domain;
|
||||
homepage = {
|
||||
group = "arr";
|
||||
description = "media-server movies downloader";
|
||||
};
|
||||
};
|
||||
environment =
|
||||
mkContainerEnvironment radarr.user.id groups.media.id
|
||||
// {
|
||||
UMASK = "002";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
44
modules/nixos/server/services/ookflix/downloading/sonarr.nix
Normal file
44
modules/nixos/server/services/ookflix/downloading/sonarr.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
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 mkContainerPort;
|
||||
inherit (config.ooknet.server.ookflix) groups volumes;
|
||||
inherit (config.ooknet.server.ookflix.services) sonarr;
|
||||
in {
|
||||
config = mkIf sonarr.enable {
|
||||
users = mkServiceUser sonarr.user.name;
|
||||
systemd.tmpfiles.settings.sonarrStateDir = mkServiceStateDir "sonarr";
|
||||
virtualisation.oci-containers.containers = {
|
||||
sonarr = {
|
||||
image = "ghcr.io/hotio/sonarr";
|
||||
autoStart = true;
|
||||
hostname = "sonarr";
|
||||
ports = [(mkContainerPort sonarr.port)];
|
||||
volumes = [
|
||||
"${sonarr.stateDir}:/config"
|
||||
"${volumes.data.root}:/data"
|
||||
];
|
||||
labels = mkContainerLabel {
|
||||
name = "sonarr";
|
||||
inherit (sonarr) port domain;
|
||||
homepage = {
|
||||
group = "arr";
|
||||
description = "media-server tv downloader";
|
||||
};
|
||||
};
|
||||
environment =
|
||||
mkContainerEnvironment sonarr.user.id groups.media.id
|
||||
// {
|
||||
UMASK = "002";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue