44 lines
787 B
Nix
44 lines
787 B
Nix
{
|
|
inputs,
|
|
constants,
|
|
config,
|
|
...
|
|
}:
|
|
|
|
let
|
|
inherit (constants) domain;
|
|
inherit (constants.hosts.rx4) ip;
|
|
inherit (constants.services.librechat-oci) fqdn port;
|
|
in
|
|
{
|
|
imports = [
|
|
inputs.synix.nixosModules.librechat-oci
|
|
];
|
|
|
|
services.librechat-oci = {
|
|
enable = true;
|
|
inherit port;
|
|
externalUrl = "https://${fqdn}";
|
|
};
|
|
|
|
services.nginx.virtualHosts."${fqdn}" = {
|
|
useACMEHost = fqdn;
|
|
forceSSL = true;
|
|
listen = [
|
|
{
|
|
addr = "${ip}:443";
|
|
ssl = true;
|
|
}
|
|
];
|
|
locations."/" = {
|
|
proxyPass = "http://127.0.0.1:${toString port}";
|
|
proxyWebsockets = true;
|
|
};
|
|
};
|
|
|
|
security.acme.certs."${fqdn}" = {
|
|
domain = fqdn;
|
|
postRun = "systemctl restart podman-librechat.service";
|
|
group = "nginx";
|
|
};
|
|
}
|