Add youtarr Nix module and register in default.nix
This commit is contained in:
parent
7087c8034c
commit
445769d002
3 changed files with 81 additions and 0 deletions
|
|
@ -9,6 +9,7 @@
|
||||||
./hardware-transcoding.nix
|
./hardware-transcoding.nix
|
||||||
./monitoring_hub.nix
|
./monitoring_hub.nix
|
||||||
./pinchflat.nix
|
./pinchflat.nix
|
||||||
|
./youtarr.nix
|
||||||
./openwebui.nix
|
./openwebui.nix
|
||||||
./trilium.nix
|
./trilium.nix
|
||||||
./oauth2-proxy.nix
|
./oauth2-proxy.nix
|
||||||
|
|
|
||||||
|
|
@ -172,6 +172,8 @@ in
|
||||||
api_base = "http://100.64.0.8:9010/air_prd";
|
api_base = "http://100.64.0.8:9010/air_prd";
|
||||||
api_key = "na";
|
api_key = "na";
|
||||||
drop_params = true;
|
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'
|
# curl -L t.net.joshuabell.xyz:9010/air_prd/models | jq '.data.[].id'
|
||||||
|
|
|
||||||
78
hosts/h001/mods/youtarr.nix
Normal file
78
hosts/h001/mods/youtarr.nix
Normal 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}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue