This commit is contained in:
mjallen18
2025-11-21 08:28:10 -06:00
parent 66ab57fce0
commit 9cadcf2eed
2 changed files with 69 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
{
lib,
config,
namespace,
...
}:
with lib;
let
inherit (lib.${namespace}) mkOpt mkReverseProxyOpt;
cfg = config.${namespace}.services.ersatztv;
in
{
options.${namespace}.services.ersatztv = {
enable = mkEnableOption "ersatztv service";
name = mkOpt types.str "ersatztv" "container name";
image = mkOpt types.str "ghcr.io/ersatztv/ersatztv" "container image";
port = mkOpt types.int 8409 "Port for ersatztv to be hosted on";
configPath = mkOpt types.str "" "Path to the data dir";
moviesPath = mkOpt types.str "" "Path to the data dir";
tvPath = mkOpt types.str "" "Path to the data dir";
transcodePath = mkOpt types.str "" "Path to the data dir";
puid = mkOpt types.str "911" "uid";
pgid = mkOpt types.str "1000" "gid";
timeZone = mkOpt types.str "America/Chicago" "Timezone";
reverseProxy = mkReverseProxyOpt;
};
config = mkIf cfg.enable {
virtualisation.oci-containers.containers.${cfg.name} = {
autoStart = true;
image = cfg.image;
extraOptions = [ "--device=/dev/dri" ];
volumes = [
"${cfg.configPath}:/config"
"${cfg.moviesPath}:/library/movies"
"${cfg.tvPath}:/library/tv"
"${cfg.transcodePath}:/transcode"
];
ports = [
"${toString cfg.port}:8409"
];
environment = {
PUID = cfg.puid;
PGID = cfg.pgid;
TZ = cfg.timeZone;
};
};
};
}

View File

@@ -35,6 +35,14 @@
ocis.enable = false;
ersatztv = {
enable = true;
configPath = "/media/nas/main/nix-app-data/ersatztv";
moviesPath = "/media/nas/main/movies";
tvPath = "/media/nas/main/tv";
transcodePath = "/media/nas/main/nix-app-data/transcode";
};
arrs = {
enable = true;
localAddress = "10.0.1.51";