mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-23 03:03:55 -05:00
38 lines
1.1 KiB
Nix
38 lines
1.1 KiB
Nix
{
|
|
pkgs,
|
|
lib,
|
|
config,
|
|
...
|
|
}: {
|
|
options = {
|
|
alyraffauf.containers.oci.jellyfin.enable =
|
|
lib.mkEnableOption "Enable Jellyfin media server.";
|
|
alyraffauf.containers.oci.jellyfin.mediaDirectory = lib.mkOption {
|
|
description = "Media directory for Jellyfin.";
|
|
default = "/mnt/Media";
|
|
type = lib.types.str;
|
|
};
|
|
alyraffauf.containers.oci.jellyfin.archiveDirectory = lib.mkOption {
|
|
description = "Archive directory for Jellyfin.";
|
|
default = "/mnt/Archive";
|
|
type = lib.types.str;
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf config.alyraffauf.containers.oci.jellyfin.enable {
|
|
virtualisation.oci-containers.containers = {
|
|
jellyfin = {
|
|
ports = ["0.0.0.0:8096:8096"];
|
|
image = "jellyfin/jellyfin";
|
|
environment = {TZ = "America/New_York";};
|
|
volumes = [
|
|
"jellyfin_config:/config"
|
|
"jellyfin_cache:/cache"
|
|
"${config.alyraffauf.containers.oci.jellyfin.mediaDirectory}:/Media"
|
|
"${config.alyraffauf.containers.oci.jellyfin.archiveDirectory}:/Archive"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|