78 lines
2.3 KiB
Nix
78 lines
2.3 KiB
Nix
{ lib, config, ... }:
|
|
{
|
|
options.jellyfin.enable = lib.mkEnableOption "enable jellfin service";
|
|
config = lib.mkIf config.jellyfin.enable {
|
|
fileSystems."/mnt/media" = {
|
|
device = "192.168.50.240:/mnt/tank/Media";
|
|
fsType = "nfs";
|
|
options = [ "defaults" ];
|
|
};
|
|
|
|
services.gatus.settings.endpoints = [
|
|
{
|
|
name = "jellyfin";
|
|
group = "local";
|
|
url = "http://localhost:8096/System/Ping";
|
|
interval = "30s";
|
|
conditions = [''[BODY] == "Jellyfin Server"''];
|
|
}
|
|
];
|
|
|
|
services.declarative-jellyfin = {
|
|
enable = true;
|
|
openFirewall = true;
|
|
serverId = "0ba4e888503b4524a90285b7ad500256"; # could be anything
|
|
system = {
|
|
serverName = config.networking.hostName;
|
|
trickplayOptions = {
|
|
enableHwAcceleration = true;
|
|
enableHwEncoding = true;
|
|
};
|
|
pluginRepositories = [
|
|
{
|
|
content.Name = "Jellyfin Stable";
|
|
content.Url = "https://repo.jellyfin.org/files/plugin/manifest.json";
|
|
tag = "RepositoryInfo"; # Needed to generate the correct XML
|
|
}
|
|
{
|
|
content.Name = "Intro Skipper";
|
|
content.Url = "https://intro-skipper.org/manifest.json";
|
|
tag = "RepositoryInfo"; # Needed to generate the correct XML
|
|
}
|
|
];
|
|
};
|
|
users.zachary = {
|
|
mutable = false;
|
|
permissions.isAdministrator = true;
|
|
hashedPasswordFile = config.sops.secrets."jellyfin/zachary".path;
|
|
};
|
|
libraries = {
|
|
Movies = {
|
|
enabled = true;
|
|
contentType = "movies";
|
|
pathInfos = ["/mnt/media/movies"];
|
|
};
|
|
Shows = {
|
|
enabled = true;
|
|
contentType = "tvshows";
|
|
pathInfos = ["/mnt/media/shows"];
|
|
};
|
|
};
|
|
encoding = {
|
|
enableHardwareEncoding = true;
|
|
hardwareAccelerationType = "vaapi";
|
|
enableDecodingColorDepth10Hevc = true; # enable if your system supports
|
|
allowHevcEncoding = true; # enable if your system supports
|
|
allowAv1Encoding = true; # enable if your system supports
|
|
hardwareDecodingCodecs = [ # enable the codecs your system supports
|
|
"h264"
|
|
"hevc"
|
|
"mpeg2video"
|
|
"vc1"
|
|
"vp9"
|
|
"av1"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|