ert
This commit is contained in:
61
modules/nixos/services/ersatztv/default.nix
Normal file
61
modules/nixos/services/ersatztv/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user