Add youtarr Nix module and register in default.nix

This commit is contained in:
Joshua Bell 2026-02-02 09:48:57 -06:00
parent 7087c8034c
commit 445769d002
3 changed files with 81 additions and 0 deletions

View file

@ -9,6 +9,7 @@
./hardware-transcoding.nix
./monitoring_hub.nix
./pinchflat.nix
./youtarr.nix
./openwebui.nix
./trilium.nix
./oauth2-proxy.nix

View file

@ -172,6 +172,8 @@ in
api_base = "http://100.64.0.8:9010/air_prd";
api_key = "na";
drop_params = true;
# TODO try this instead of sanitized name
# additional_drop_params = if [ "messages[*].cacheControl" ];
};
})
# curl -L t.net.joshuabell.xyz:9010/air_prd/models | jq '.data.[].id'

View file

@ -0,0 +1,78 @@
{
lib,
config,
...
}:
let
name = "youtarr";
gid = 187;
uid = 187;
port = 3087;
hostConfigDir = "/var/lib/${name}";
mediaDir = "/nfs/h002/${name}/media";
in
{
config = lib.mkIf config.nixarr.enable {
virtualisation.oci-containers.containers = {
"${name}" = {
image = "dialmaster/youtarr:latest";
ports = [
"${toString port}:${toString port}"
];
volumes = [
"${hostConfigDir}:/config"
"${mediaDir}:/downloads"
];
environment = {
PUID = toString uid;
PGID = toString gid;
};
};
};
users = {
groups.${name}.gid = gid;
users.${name} = {
isSystemUser = true;
group = name;
uid = uid;
};
};
systemd.tmpfiles.rules = [
"d '${hostConfigDir}' 0775 ${name} ${name} - -"
"d '${mediaDir}' 0775 ${name} ${name} - -"
];
# Use Nixarr vpn
systemd.services.podman-youtarr.vpnconfinement = {
enable = true;
vpnnamespace = "wg";
};
vpnNamespaces.wg.portMappings = [
{
from = port;
to = port;
}
];
services.nginx = {
virtualHosts = {
"${name}" = {
serverName = "h001.net.joshuabell.xyz";
listen = [
{
port = port;
addr = "0.0.0.0";
}
];
locations."/" = {
proxyWebsockets = true;
proxyPass = "http://192.168.15.1:${toString port}";
};
};
};
};
};
}