nix-config/modules/data-hoarder/trekkie.nix

48 lines
1.1 KiB
Nix
Raw Normal View History

2022-09-08 19:14:39 +02:00
{ config, ... }:
{
2022-12-30 18:29:13 +01:00
TLMS.trekkie = {
2022-09-08 19:14:39 +02:00
enable = true;
host = "0.0.0.0";
2022-10-08 01:40:06 +02:00
saltPath = config.sops.secrets.postgres_password_hash_salt.path;
2022-09-08 19:14:39 +02:00
port = 8060;
database = {
host = "127.0.0.1";
port = config.services.postgresql.port;
passwordFile = config.sops.secrets.postgres_password.path;
};
redis = {
port = 6379;
2022-10-08 22:30:25 +02:00
host = "localhost";
};
2022-10-08 11:50:13 +02:00
logLevel = "info";
2022-09-08 19:14:39 +02:00
};
2022-10-08 00:47:23 +02:00
systemd.services."trekkie" = {
2022-09-08 19:14:39 +02:00
after = [ "postgresql.service" ];
wants = [ "postgresql.service" ];
};
2022-10-08 01:08:08 +02:00
services = {
redis.servers."trekkie" = {
2022-10-08 19:37:05 +02:00
enable = true;
2022-12-30 18:29:13 +01:00
bind = config.TLMS.trekkie.redis.host;
port = config.TLMS.trekkie.redis.port;
2022-10-08 19:37:05 +02:00
};
2022-10-08 01:08:08 +02:00
nginx = {
enable = true;
recommendedProxySettings = true;
virtualHosts = {
2022-12-30 18:29:13 +01:00
"trekkie.${config.deployment-TLMS.domain}" = {
2022-10-08 01:08:08 +02:00
forceSSL = true;
enableACME = true;
locations = {
"/" = {
2022-12-30 18:29:13 +01:00
proxyPass = with config.TLMS.trekkie; "http://${host}:${toString port}/";
2022-10-08 01:08:08 +02:00
};
};
};
};
};
};
2022-09-08 19:14:39 +02:00
}