2023-02-12 23:33:57 +01:00
|
|
|
{ lib, pkgs, config, ... }:
|
2023-02-12 00:32:13 +01:00
|
|
|
|
2023-02-12 23:33:57 +01:00
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.reo101.jellyfin;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
imports = [
|
2023-02-12 00:32:13 +01:00
|
|
|
];
|
|
|
|
|
2023-02-12 23:33:57 +01:00
|
|
|
options = {
|
|
|
|
reo101.jellyfin = {
|
|
|
|
enable = mkEnableOption "reo101 Jellyfin config";
|
|
|
|
image = mkOption {
|
|
|
|
type = types.strMatching ".+/.+:.+";
|
|
|
|
default = "docker.io/jellyfin/jellyfin:latest";
|
|
|
|
defaultText = "docker.io/jellyfin/jellyfin:latest";
|
|
|
|
description = ''
|
|
|
|
The Docker image for Jellyfin
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
volumes = mkOption {
|
|
|
|
type = types.listOf (types.strMatching ".+:.+");
|
|
|
|
default = [
|
|
|
|
"/var/cache/jellyfin/config:/config"
|
|
|
|
"/var/cache/jellyfin/cache:/cache"
|
|
|
|
"/var/log/jellyfin:/log"
|
|
|
|
"/media:/media:ro"
|
|
|
|
];
|
|
|
|
description = ''
|
|
|
|
The volumes the Jellyfin container should bind to
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
ports = mkOption {
|
|
|
|
type = types.listOf (types.strMatching ".+:.+");
|
|
|
|
default = [
|
|
|
|
"8096:8096"
|
|
|
|
];
|
|
|
|
description = ''
|
|
|
|
The ports the Jellyfin container should bind to
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-02-12 00:32:13 +01:00
|
|
|
|
2023-02-12 23:33:57 +01:00
|
|
|
config = mkIf cfg.enable {
|
|
|
|
virtualisation.oci-containers.containers."jellyfin" = {
|
|
|
|
autoStart = true;
|
|
|
|
image = cfg.image;
|
|
|
|
volumes = cfg.volumes;
|
|
|
|
ports = cfg.ports;
|
|
|
|
environment = {
|
|
|
|
JELLYFIN_LOG_DIR = "/log";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-02-12 00:32:13 +01:00
|
|
|
|
2023-02-12 23:33:57 +01:00
|
|
|
meta = {
|
|
|
|
maintainers = with lib.maintainers; [ reo101 ];
|
|
|
|
};
|
|
|
|
}
|