ookflix: segment modules
This commit is contained in:
parent
4edb21607c
commit
bee284691a
21 changed files with 314 additions and 100 deletions
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