- Update `DOMAIN` in `hosts/desktop/homeserver.nix` to `roadtotech.me`. - Update `DOMAIN_SUFFIX` and all service subdomains in `hosts/desktop/traefik-deployments.nix` to the new root domain. - Introduce explicit environment variables for dashboard, landing page, and Minecraft subdomains.
97 lines
3.3 KiB
Nix
97 lines
3.3 KiB
Nix
# 🌐 Traefik Deployments Environment Secrets configuration
|
|
# This NixOS module manages secrets and environment variables for the unified apps in /traefik-deployments
|
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
# Load the encrypted secrets file
|
|
sops.defaultSopsFile = ./secrets.yaml;
|
|
sops.defaultSopsFormat = "yaml";
|
|
|
|
# Define the keys to decrypt from secrets.yaml (avoiding repeating the owner boilerplate)
|
|
sops.secrets = lib.genAttrs [
|
|
"learning_turso_db_url"
|
|
"learning_turso_auth_token"
|
|
"mongo_root_username"
|
|
"mongo_root_password"
|
|
"ollama_api_key"
|
|
"postgres_user"
|
|
"postgres_password"
|
|
"postgres_db"
|
|
] (name: { owner = "kiskaadee"; });
|
|
|
|
# Generate the unified environment file at runtime in /run/secrets/traefik-deployments.env
|
|
sops.templates."traefik-deployments.env" = {
|
|
owner = "kiskaadee";
|
|
content = lib.generators.toKeyValue {} {
|
|
# --- Core / Infrastructure Settings ---
|
|
PROXY_NETWORK = "proxy-net";
|
|
CERT_RESOLVER = "myresolver";
|
|
DOMAIN_SUFFIX = "roadtotech.me";
|
|
|
|
# --- Dashboard & Landing ---
|
|
DASHBOARD_DOMAIN = "dashboard.roadtotech.me";
|
|
LANDING_DOMAIN = "roadtotech.me";
|
|
|
|
# --- Docs ---
|
|
DOCS_DOMAIN = "docs.roadtotech.me";
|
|
DOCS_PROJECT_PATH = "/home/kiskaadee/Learn/backend-residency";
|
|
|
|
# --- Excalidraw ---
|
|
EXCALIDRAW_DOMAIN = "excalidraw.roadtotech.me";
|
|
|
|
# --- Gitea ---
|
|
GITEA_DOMAIN = "gitea.roadtotech.me";
|
|
GITEA_SSH_DOMAIN = "gitea.roadtotech.me";
|
|
GITEA_AUTH_MIDDLEWARE = "https-redirect@docker";
|
|
|
|
# --- Jellyfin ---
|
|
JELLYFIN_SERVICE_NAME = "jellyfin";
|
|
JELLYFIN_CONTAINER_NAME = "jellyfin";
|
|
JELLYFIN_IMAGE_TAG = "latest";
|
|
JELLYFIN_DOMAIN = "jellyfin.roadtotech.me";
|
|
JELLYFIN_TZ = "UTC";
|
|
JELLYFIN_PUID = "1000";
|
|
JELLYFIN_PGID = "1000";
|
|
JELLYFIN_MEDIA_PATH = "/media";
|
|
JELLYFIN_HTTP_ENTRYPOINT = "web";
|
|
JELLYFIN_HTTPS_ENTRYPOINT = "websecure";
|
|
JELLYFIN_RATE_LIMIT_AVG = "100";
|
|
JELLYFIN_RATE_LIMIT_BURST = "50";
|
|
|
|
# --- Learning Dashboard ---
|
|
LEARNING_SERVICE_NAME = "learning-hub";
|
|
LEARNING_DOMAIN = "learning.roadtotech.me";
|
|
LEARNING_APP_PORT = "8000";
|
|
LEARNING_SOCKET_PROXY_NETWORK = "socket-net";
|
|
LEARNING_DOCKER_HOST = "tcp://socket-proxy:2375";
|
|
TURSO_DATABASE_URL = config.sops.placeholder.learning_turso_db_url;
|
|
TURSO_AUTH_TOKEN = config.sops.placeholder.learning_turso_auth_token;
|
|
|
|
# --- Mermaid ---
|
|
MERMAID_DOMAIN = "mermaid.roadtotech.me";
|
|
MERMAID_SERVICE_NAME = "mermaid";
|
|
|
|
# --- Minecraft ---
|
|
MINECRAFT_DOMAIN = "minecraft.roadtotech.me";
|
|
|
|
# --- MongoDB ---
|
|
MONGO_ROOT_USERNAME = config.sops.placeholder.mongo_root_username;
|
|
MONGO_ROOT_PASSWORD = config.sops.placeholder.mongo_root_password;
|
|
MONGO_DOMAIN = "mongodb.roadtotech.me";
|
|
|
|
# --- PostgreSQL ---
|
|
POSTGRES_USER = config.sops.placeholder.postgres_user;
|
|
POSTGRES_PASSWORD = config.sops.placeholder.postgres_password;
|
|
POSTGRES_DB = config.sops.placeholder.postgres_db;
|
|
POSTGRES_DOMAIN = "pgsql.roadtotech.me";
|
|
|
|
# --- Ollama ---
|
|
OLLAMA_DOMAIN = "ollama.roadtotech.me";
|
|
OLLAMA_API_KEY = config.sops.placeholder.ollama_api_key;
|
|
OLLAMA_REPLICAS = "1";
|
|
OLLAMA_DATA_VOLUME = "ollama_data";
|
|
};
|
|
};
|
|
}
|