68 lines
1.7 KiB
Nix
68 lines
1.7 KiB
Nix
{ config, containerCfg, pkgs, lib, builder, name, ... }:
|
|
let
|
|
serverCfg = config.syscfg.server;
|
|
image = pkgs.dockerTools.streamLayeredImage { # pkgs.dockerTools.buildImage{#
|
|
name = pkgs.jellyfin.name;
|
|
tag = pkgs.jellyfin.version;
|
|
contents = [
|
|
pkgs.cacert
|
|
];
|
|
config = {
|
|
Entrypoint = [ "${pkgs.jellyfin}/bin/jellyfin" ];
|
|
ExposedPorts = { "8096/tcp" = { }; };
|
|
};
|
|
};
|
|
|
|
#LDAP_DC_DOMAIN = "dc=ldap,dc=helcel,dc=net"
|
|
#HOST=...
|
|
#LDAP_BIND_USER=ldap-sa
|
|
#LDAP_BIND_PASSWORD=...
|
|
#LDAP_GROUP=flix
|
|
#LDAP_ADMIN=admin
|
|
|
|
in {
|
|
paths = [
|
|
{
|
|
path = "${serverCfg.dataPath}/media/";
|
|
mode = "0755";
|
|
}
|
|
{
|
|
path = "${serverCfg.configPath}/jellyfin/";
|
|
mode = "0755";
|
|
}
|
|
];
|
|
|
|
containers = {
|
|
server = builder.mkContainer {
|
|
subdomain = containerCfg.subdomain;
|
|
imageStream = image;
|
|
# imageFile = image;
|
|
port = 8096;
|
|
# secret = name;
|
|
extraEnv = {
|
|
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT = "1";
|
|
# JELLYFIN_WEB_DIR = "${pkgs.jellyfin-web}/share/jellyfin-web";
|
|
JELLYFIN_HttpListenerHost__BindAddress= "0.0.0.0"; #we can use settings.xml override
|
|
};
|
|
extraOptions = [
|
|
"--tmpfs=/tmp:rw,noexec,nosuid,size=512m"
|
|
];
|
|
overrides = {
|
|
cmd = [
|
|
"--datadir" "/config/data"
|
|
"--cachedir" "/config/cache"
|
|
"--configdir" "/config/config"
|
|
"--logdir" "/config/log"
|
|
];
|
|
volumes = [
|
|
"${serverCfg.dataPath}/media:/media:ro"
|
|
"${serverCfg.configPath}/jellyfin:/config"
|
|
];
|
|
# If you have an Intel/AMD GPU for transcoding, add the device:
|
|
devices = lib.optionals (builtins.pathExists "/dev/dri") [ "/dev/dri:/dev/dri" ];
|
|
};
|
|
};
|
|
};
|
|
|
|
|
|
} |