unmanic, calibre

This commit is contained in:
mjallen18
2025-10-02 21:26:27 -05:00
parent e72d1b5d93
commit ee48ca08bd
11 changed files with 320 additions and 116 deletions

View File

@@ -0,0 +1,61 @@
{
lib,
config,
namespace,
...
}:
with lib;
let
inherit (lib.${namespace}) mkOpt mkReverseProxyOpt;
cfg = config.${namespace}.services.unmanic;
in
{
options.${namespace}.services.unmanic = {
enable = mkEnableOption "unmanic service";
name = mkOpt types.str "unmanic" "container name";
image = mkOpt types.str "josh5/unmanic" "container image";
port = mkOpt types.int 8265 "Port for unmanic 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}:/tmp/unmanic"
];
ports = [
"${toString cfg.port}:8888"
];
environment = {
PUID = cfg.puid;
PGID = cfg.pgid;
TZ = cfg.timeZone;
};
};
};
}