masive rewriting and setup of server files

This commit is contained in:
2024-09-28 23:10:03 -06:00
parent f9399c51fa
commit 9151ca5971
39 changed files with 756 additions and 556 deletions

View File

@@ -10,14 +10,15 @@ let
in
{
options.my.servers.maloja = setup.mkOptions "maloja" "maloja" 42010;
config = lib.mkIf cfg.enable {
sops.secrets.maloja.sopsFile = ../../secrets/env.yaml;
virtualisation.oci-containers.containers.maloja = {
image = "krateng/maloja";
config = {
networking.firewall.allowedTCPPorts = lib.mkIf (!cfg.isLocal) [ cfg.port ];
sops.secrets = lib.mkIf cfg.enable { maloja.sopsFile = ../../secrets/env.yaml; };
virtualisation.oci-containers.containers.maloja = lib.mkIf cfg.enable {
image = "krateng/maloja:latest";
ports = [ "${toString cfg.port}:${toString cfg.port}" ];
environmentFiles = [ config.sops.secrets.maloja.path ];
environment = {
TZ = "America/Mexico_City";
TZ = config.my.timeZone;
MALOJA_TIMEZONE = "-6";
PUID = "1000";
PGID = "100";
@@ -32,6 +33,8 @@ in
"flame.icon" = "bookmark-music";
};
};
services.nginx.virtualHosts."${cfg.host}" = proxyReverse cfg.port // { };
services.nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (
proxyReverse cfg.hostName cfg.port // { }
);
};
}