48 lines
1.0 KiB
Nix
Executable File
48 lines
1.0 KiB
Nix
Executable File
{
|
|
lib,
|
|
config,
|
|
namespace,
|
|
...
|
|
}:
|
|
with lib;
|
|
let
|
|
cfg = config.${namespace}.services.tdarr;
|
|
in
|
|
{
|
|
imports = [ ./options.nix ];
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
virtualisation.oci-containers.containers.${cfg.name} = {
|
|
autoStart = true;
|
|
image = cfg.image;
|
|
extraOptions = [ "--device=nvidia.com/gpu=0" ];
|
|
volumes = [
|
|
"${cfg.configPath}:/app/configs"
|
|
"${cfg.serverPath}:/app/server"
|
|
"${cfg.logPath}:/app/logs"
|
|
"${cfg.transcodePath}:/temp"
|
|
"${cfg.moviesPath}:/data/movies"
|
|
"${cfg.tvPath}:/data/tv"
|
|
];
|
|
ports = [
|
|
"${cfg.serverPort}:8266"
|
|
"${cfg.webUIPort}:8265"
|
|
];
|
|
environment = {
|
|
serverPort = "8266";
|
|
webUIPort = "8265";
|
|
internalNode = "true";
|
|
inContainer = "true";
|
|
ffmpegVersion = "6";
|
|
nodeName = "tdarr node";
|
|
NVIDIA_VISIBLE_DEVICES = "all";
|
|
NVIDIA_DRIVER_CAPABILITIES = "all";
|
|
PUID = cfg.puid;
|
|
PGID = cfg.pgid;
|
|
TZ = cfg.timeZone;
|
|
};
|
|
};
|
|
};
|
|
}
|