ryot > yamtrack

This commit is contained in:
Danilo Reyes
2026-02-01 19:56:53 -06:00
parent 6389b9f012
commit 6bdef87118
6 changed files with 47 additions and 8 deletions

View File

@@ -0,0 +1,38 @@
{
lib,
config,
...
}:
let
setup = import ../factories/mkserver.nix { inherit lib config; };
cfg = config.my.servers.yamtrack;
in
{
options.my.servers.yamtrack = setup.mkOptions "yamtrack" "tracker" 8765;
config = lib.mkIf (cfg.enable && config.my.servers.postgres.enable && config.my.secureHost) {
sops.secrets.yamtrack.sopsFile = ../../secrets/env.yaml;
virtualisation.oci-containers.containers = {
yamtrack-redis.image = "redis:7-alpine";
yamtrack = {
image = "ghcr.io/fuzzygrim/yamtrack";
ports = [ "${toString cfg.port}:8000" ];
dependsOn = [ "yamtrack-redis" ];
environmentFiles = [ config.sops.secrets.yamtrack.path ];
environment = {
TZ = config.my.timeZone;
URLS = cfg.url;
DB_HOST = config.my.postgresSocket;
DB_NAME = cfg.name;
DB_USER = cfg.name;
DB_PORT = toString 5432;
REGISTRATION = "true";
SOCIALACCOUNT_ONLY = "true";
REDIRECT_LOGIN_TO_SSO = "true";
REDIS_URL = "redis://yamtrack-redis:6379/0";
SOCIAL_PROVIDERS = "allauth.socialaccount.providers.openid_connect";
};
volumes = [ "${config.my.postgresSocket}:${config.my.postgresSocket}" ];
};
};
};
}