feat: add Jellyfin service module with configuration options
This commit is contained in:
parent
a44533a0e0
commit
3c44bbc034
@ -3,6 +3,7 @@
|
|||||||
./bazarr
|
./bazarr
|
||||||
./gitea
|
./gitea
|
||||||
./immich
|
./immich
|
||||||
|
./jellyfin
|
||||||
./prowlarr
|
./prowlarr
|
||||||
./radarr
|
./radarr
|
||||||
./sonarr
|
./sonarr
|
||||||
|
68
modules/services/jellyfin/default.nix
Normal file
68
modules/services/jellyfin/default.nix
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf mkForce;
|
||||||
|
|
||||||
|
cfg = config.pepe.services.jellyfin;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.pepe.services.jellyfin = with lib; {
|
||||||
|
enable = mkEnableOption "Enable jellyfin";
|
||||||
|
package = mkPackageOption pkgs "jellyfin" { };
|
||||||
|
domain = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
tmpfsSize = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "20G";
|
||||||
|
description = "Size of the tmpfs mount for Jellyfin";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
# needed since StateDirectory does not accept symlinks
|
||||||
|
systemd.services.jellyfin.serviceConfig.StateDirectory = mkForce "";
|
||||||
|
|
||||||
|
architect.vhost.${cfg.domain} = with config.architect.networks; {
|
||||||
|
dnsInterfaces = [ "lan" "tailscale" ];
|
||||||
|
locations = {
|
||||||
|
"/" = {
|
||||||
|
port = 8096;
|
||||||
|
allowLan = true;
|
||||||
|
allow = [
|
||||||
|
tailscale.net
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
"/socket" = {
|
||||||
|
port = 8096;
|
||||||
|
allowLan = true;
|
||||||
|
proxyWebsockets = true;
|
||||||
|
allow = [
|
||||||
|
tailscale.net
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.jellyfin = {
|
||||||
|
enable = true;
|
||||||
|
group = "media";
|
||||||
|
package = cfg.package;
|
||||||
|
};
|
||||||
|
|
||||||
|
users.groups = {
|
||||||
|
video.members = [ "jellyfin" ];
|
||||||
|
render.members = [ "jellyfin" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
pepe.core.media.groupMembers = mkIf config.pepe.core.media.enable [ "jellyfin" ];
|
||||||
|
|
||||||
|
fileSystems."/tmp/jellyfin" = {
|
||||||
|
device = "none";
|
||||||
|
fsType = "tmpfs";
|
||||||
|
options = [ "defaults" "size=${cfg.tmpfsSize}" "uid=jellyfin" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user