{ moduleFunctions }:
let
  inherit (moduleFunctions.instancesFunctions)
    domain0
    servicePath
    sslPath
    sopsPath
    ;

  label = "Ollama";
  name = "ollama";
  domain = "${name}.${domain0}";
in
{
  label = label;
  name = name;
  short = label;
  sops = {
    path0 = "${sopsPath}/${name}";
  };
  domains = {
    url0 = domain;
  };
  subdomain = name;
  tags = [
    name
    "chat"
    "ai"
  ];
  paths = {
    path0 = "${servicePath}/${label}";
    path1 = "/mnt/media/storage/${name}";
  };
  ports = {
    port0 = 8088; # Open-WebUI (Ollama Front End)
    port1 = 11434; # Ollama API
  };
  ssl = {
    cert = "${sslPath}/${name}.${domain0}/fullchain.pem";
    key = "${sslPath}/${name}.${domain0}/key.pem";
  };
}
