28 current 2025-10-07 15:30:08 25.05.20251001.5b5be50 6.12.49 *

This commit is contained in:
2025-10-07 15:46:39 -05:00
parent 49079aa26f
commit 0532a731e5
3 changed files with 34 additions and 13 deletions

View File

@@ -3,17 +3,24 @@
let
cfg = config.modules.services.jellyfin;
ids = 701;
default_port = 8096;
data_dir = "/var/lib/jellyfin";
in
{
options.modules.services.jellyfin = {
enable = lib.mkEnableOption "enables jellyfin";
# extra options
# mode = lib.mkOption {
# type = lib.types.enum [ "server" "client" ];
# default = "client";
# description = "whether syncthing should run as a client (user) or server (system-wide).";
# };
# set port options
port = lib.mkOption {
type = lib.types.int;
default = cfg.default_port;
description = "set port for jellyfin (default: ${toString default_port}";
};
backup = lib.mkOption {
type = lib.types.bool;
default = true;
};
};
config = lib.mkIf cfg.enable {
@@ -26,7 +33,7 @@ in
description = "jellyfin media server user";
uid = ids;
isSystemUser = true;
home = "/var/lib/jellyfin";
home = data_dir;
createHome = true;
group = "jellyfin";
extraGroups = [ "media" "video" "render" ];
@@ -45,7 +52,7 @@ in
systemd.services.jellyfin.serviceConfig = { UMask = lib.mkForce "0007"; };
# open firewall
#networking.firewall.allowedTCPPorts = [ 8096 ];
# networking.firewall.allowedTCPPorts = [ cfg.port ];
# reverse proxy entryo
services.nginx.virtualHosts."media.blakedheld.xyz" = {
@@ -54,8 +61,11 @@ in
sslCertificate = config.sops.secrets."ssl_blakedheld_crt".path;
sslCertificateKey = config.sops.secrets."ssl_blakedheld_key".path;
locations."/" = {
proxyPass = "http://127.0.0.1:8096";
proxyPass = "http://127.0.0.1:${toString cfg.port}";
};
};
# add to backups
modules.system.backups.paths = lib.mkIf cfg.backup [ data_dir ];
};
}