37 lines
892 B
Nix
37 lines
892 B
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
with lib;
|
|
let
|
|
cfg = config.vps.remnawave;
|
|
domain = config.sops.placeholder."domain";
|
|
in
|
|
{
|
|
config = mkIf (cfg.enable && cfg.type == "panel") {
|
|
sops.secrets = {
|
|
"domain" = { };
|
|
"panel/app-secret" = { };
|
|
"panel/postgres-password" = { };
|
|
};
|
|
|
|
sops.templates."remnapanel.env" = {
|
|
mode = "0400";
|
|
content = ''
|
|
APP_PORT=3000
|
|
METRICS_PORT=3001
|
|
API_INSTANCES=1
|
|
DATABASE_URL=postgresql://postgres:${config.sops.placeholder."panel/postgres-password"}@remnawave-db:5432/postgres
|
|
REDIS_HOST=remnawave-valkey
|
|
REDIS_PORT=6379
|
|
APP_SECRET=${config.sops.placeholder."panel/app-secret"}
|
|
IS_TELEGRAM_NOTIFICATIONS_ENABLED=false
|
|
WEBHOOK_ENABLED=false
|
|
FRONT_END_DOMAIN=${cfg.subdomain}.${domain}
|
|
SUB_PUBLIC_DOMAIN=sub.${domain}
|
|
'';
|
|
};
|
|
};
|
|
}
|