mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-04-04 03:01:05 +02:00
Added a (tiny) bit of modularity in the mediaserver module
This commit is contained in:
parent
08df42e079
commit
8e4ddf4ef0
6 changed files with 213 additions and 133 deletions
|
@ -3,22 +3,37 @@ with lib;
|
|||
let
|
||||
cfg = config.luj.jackett;
|
||||
port = 9117;
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.luj.jackett = {
|
||||
enable = mkEnableOption "activate jackett service";
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = "jackett";
|
||||
description = "User account under which Jackett runs.";
|
||||
};
|
||||
|
||||
group = mkOption {
|
||||
type = types.str;
|
||||
default = "jackett";
|
||||
description = "Group under which Jackett runs.";
|
||||
};
|
||||
|
||||
nginx.enable = mkEnableOption "activate nginx";
|
||||
nginx.subdomain = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (
|
||||
mkMerge [{
|
||||
services.jackett = {
|
||||
enable = true;
|
||||
user = "mediaserver";
|
||||
group = "mediaserver";
|
||||
user = cfg.user;
|
||||
group = cfg.group;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -32,8 +47,7 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
})
|
||||
]);
|
||||
})]);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -3,10 +3,25 @@ with lib;
|
|||
let
|
||||
cfg = config.luj.jellyfin;
|
||||
port = 8096;
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.luj.jellyfin = {
|
||||
|
||||
enable = mkEnableOption "activate jellyfin service";
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = "jellyfin";
|
||||
description = "User account under which Jellyfin runs.";
|
||||
};
|
||||
|
||||
group = mkOption {
|
||||
type = types.str;
|
||||
default = "jellyfin";
|
||||
description = "Group under which Jellyfin runs.";
|
||||
};
|
||||
|
||||
nginx.enable = mkEnableOption "activate nginx";
|
||||
nginx.subdomain = mkOption {
|
||||
type = types.str;
|
||||
|
@ -17,9 +32,8 @@ in {
|
|||
mkMerge [{
|
||||
services.jellyfin = {
|
||||
enable = true;
|
||||
user = "mediaserver";
|
||||
group = "mediaserver";
|
||||
package = pkgs.jellyfin;
|
||||
user = cfg.user;
|
||||
group = cfg.group;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -33,8 +47,7 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
})
|
||||
]);
|
||||
})]);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -23,30 +23,40 @@ in {
|
|||
|
||||
luj.sonarr = {
|
||||
enable = true;
|
||||
user = "mediaserver";
|
||||
group = "mediaserver";
|
||||
nginx.enable = true;
|
||||
nginx.subdomain = "series";
|
||||
};
|
||||
|
||||
luj.radarr = {
|
||||
enable = true;
|
||||
user = "mediaserver";
|
||||
group = "mediaserver";
|
||||
nginx.enable = true;
|
||||
nginx.subdomain = "films";
|
||||
};
|
||||
|
||||
luj.jellyfin = {
|
||||
enable = true;
|
||||
user = "mediaserver";
|
||||
group = "mediaserver";
|
||||
nginx.enable = true;
|
||||
nginx.subdomain = "tv";
|
||||
};
|
||||
|
||||
luj.jackett = {
|
||||
enable = true;
|
||||
user = "mediaserver";
|
||||
group = "mediaserver";
|
||||
nginx.enable = true;
|
||||
nginx.subdomain = "jackett";
|
||||
};
|
||||
|
||||
luj.transmission = {
|
||||
enable = true;
|
||||
user = "mediaserver";
|
||||
group = "mediaserver";
|
||||
nginx.enable = true;
|
||||
nginx.subdomain = "downloads";
|
||||
};
|
||||
|
|
|
@ -3,22 +3,38 @@ with lib;
|
|||
let
|
||||
cfg = config.luj.radarr;
|
||||
port = 7878;
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.luj.radarr = {
|
||||
|
||||
enable = mkEnableOption "activate radarr service";
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = "radarr";
|
||||
description = "User account under which Radarr runs.";
|
||||
};
|
||||
|
||||
group = mkOption {
|
||||
type = types.str;
|
||||
default = "radarr";
|
||||
description = "Group under which Radarr runs.";
|
||||
};
|
||||
|
||||
nginx.enable = mkEnableOption "activate nginx";
|
||||
nginx.subdomain = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (
|
||||
mkMerge [{
|
||||
services.radarr = {
|
||||
enable = true;
|
||||
user = "mediaserver";
|
||||
group = "mediaserver";
|
||||
user = cfg.user;
|
||||
group = cfg.group;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -32,8 +48,7 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
})
|
||||
]);
|
||||
})]);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -3,22 +3,38 @@ with lib;
|
|||
let
|
||||
cfg = config.luj.sonarr;
|
||||
port = 8989;
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.luj.sonarr = {
|
||||
|
||||
enable = mkEnableOption "activate sonarr service";
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = "sonarr";
|
||||
description = "User account under which Sonarr runs.";
|
||||
};
|
||||
|
||||
group = mkOption {
|
||||
type = types.str;
|
||||
default = "sonarr";
|
||||
description = "Group under which Sonarr runs.";
|
||||
};
|
||||
|
||||
nginx.enable = mkEnableOption "activate nginx";
|
||||
nginx.subdomain = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (
|
||||
mkMerge [{
|
||||
services.sonarr = {
|
||||
enable = true;
|
||||
user = "mediaserver";
|
||||
group = "mediaserver";
|
||||
user = cfg.user;
|
||||
group = cfg.group;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -32,8 +48,7 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
})
|
||||
]);
|
||||
})]);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -3,30 +3,44 @@ with lib;
|
|||
let
|
||||
cfg = config.luj.transmission;
|
||||
port = 9091;
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
options.luj.transmission = {
|
||||
enable = mkEnableOption "activate transmission service";
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = "transmission";
|
||||
description = "User account under which transmission runs.";
|
||||
};
|
||||
|
||||
group = mkOption {
|
||||
type = types.str;
|
||||
default = "transmission";
|
||||
description = "Group under which Transmission runs.";
|
||||
};
|
||||
|
||||
nginx.enable = mkEnableOption "activate nginx";
|
||||
nginx.subdomain = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (
|
||||
mkMerge [{
|
||||
|
||||
|
||||
sops.secrets.transmission = {
|
||||
owner = "mediaserver";
|
||||
owner = cfg.user;
|
||||
format = "binary";
|
||||
sopsFile = ../../secrets/transmission-login;
|
||||
};
|
||||
|
||||
services.transmission = {
|
||||
enable = true;
|
||||
user = "mediaserver";
|
||||
group = "mediaserver";
|
||||
user = cfg.user;
|
||||
group = cfg.group;
|
||||
credentialsFile = "/run/secrets/transmission";
|
||||
downloadDirPermissions = "770";
|
||||
settings = {
|
||||
|
@ -48,8 +62,7 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
})
|
||||
]);
|
||||
})]);
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue