ryot > yamtrack
This commit is contained in:
38
modules/servers/yamtrack.nix
Normal file
38
modules/servers/yamtrack.nix
Normal 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}" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user