2024-08-09 22:10:25 +07:00
|
|
|
{ config, lib, ... }:
|
|
|
|
let
|
|
|
|
name = "morphos";
|
|
|
|
podman = config.profile.podman;
|
|
|
|
inherit (lib) mkIf;
|
|
|
|
ip = "10.88.88.2";
|
|
|
|
image = "ghcr.io/danvergara/morphos-server:latest";
|
|
|
|
domain = "${name}.tigor.web.id";
|
|
|
|
user = config.profile.user;
|
|
|
|
uid = toString user.uid;
|
|
|
|
gid = toString user.gid;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
config = mkIf (podman.enable && podman.${name}.enable) {
|
|
|
|
services.caddy.virtualHosts.${domain}.extraConfig = ''
|
|
|
|
reverse_proxy ${ip}:8080
|
|
|
|
'';
|
|
|
|
|
2024-11-24 20:16:30 +07:00
|
|
|
services.nginx.virtualHosts.${domain} = {
|
2024-11-24 21:31:04 +07:00
|
|
|
useACMEHost = "tigor.web.id";
|
2024-11-24 20:16:30 +07:00
|
|
|
forceSSL = true;
|
|
|
|
locations."/".proxyPass = "http://${ip}:8080";
|
|
|
|
};
|
|
|
|
|
2024-11-24 21:31:04 +07:00
|
|
|
security.acme.certs."tigor.web.id".extraDomainNames = [ domain ];
|
|
|
|
|
2024-08-09 22:10:25 +07:00
|
|
|
virtualisation.oci-containers.containers.${name} = {
|
|
|
|
inherit image;
|
|
|
|
hostname = name;
|
|
|
|
autoStart = true;
|
|
|
|
user = "${uid}:${gid}";
|
|
|
|
environment = {
|
|
|
|
TZ = "Asia/Jakarta";
|
|
|
|
};
|
2024-10-21 12:31:30 +07:00
|
|
|
volumes = [ "/tmp:/tmp" ];
|
2024-08-09 22:10:25 +07:00
|
|
|
extraOptions = [
|
|
|
|
"--network=podman"
|
|
|
|
"--ip=${ip}"
|
|
|
|
];
|
|
|
|
labels = {
|
|
|
|
"io.containers.autoupdate" = "registry";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|