49 lines
1.2 KiB
Nix
Executable File
49 lines
1.2 KiB
Nix
Executable File
{
|
|
lib,
|
|
config,
|
|
namespace,
|
|
...
|
|
}:
|
|
let
|
|
inherit (lib.${namespace}) mkOpt mkContainerService;
|
|
cfg = config.${namespace}.services.tdarr;
|
|
in
|
|
{
|
|
imports = [
|
|
(mkContainerService {
|
|
inherit config;
|
|
name = "tdarr";
|
|
image = "ghcr.io/haveagitgat/tdarr";
|
|
internalPort = 8265;
|
|
options = {
|
|
serverPort = mkOpt lib.types.str "8266" "Tdarr node server port";
|
|
};
|
|
extraOptions = [ "--device=nvidia.com/gpu=0" ];
|
|
volumes = [
|
|
"${cfg.configDir}/tdarr/config:/app/configs"
|
|
"${cfg.configDir}/tdarr/server:/app/server"
|
|
"${cfg.configDir}/tdarr/logs:/app/logs"
|
|
"${cfg.configDir}/tdarr/transcode:/temp"
|
|
"${cfg.dataDir}/movies:/data/movies"
|
|
"${cfg.dataDir}/tv:/data/tv"
|
|
];
|
|
environment = {
|
|
serverPort = "8266";
|
|
webUIPort = "8265";
|
|
internalNode = "true";
|
|
inContainer = "true";
|
|
ffmpegVersion = "6";
|
|
nodeName = "tdarr node";
|
|
NVIDIA_VISIBLE_DEVICES = "all";
|
|
NVIDIA_DRIVER_CAPABILITIES = "all";
|
|
};
|
|
extraConfig = {
|
|
virtualisation.oci-containers.containers.tdarr.ports = lib.mkForce [
|
|
"${cfg.serverPort}:8266"
|
|
"${toString cfg.port}:8265"
|
|
];
|
|
};
|
|
})
|
|
];
|
|
}
|