Phase 1 & 2 of the homelab-core NixOS migration plan.
Adds a fully standalone NixOS flake configuration targeting the
roadtotech.me homelab server. Goal: wipe & restore from any bare
NixOS install via `nixos-install --flake ~/Core#server`.
Changes:
- flake.nix: 2-input flake (nixpkgs channel tarball + sops-nix)
- flake.lock: generated lockfile pinning nixos-26.11pre1070770.8ce4ef6
- .sops.yaml: SOPS rules scoped to nixos/secrets.yaml (server + laptop keys)
- nixos/configuration.nix: clean standalone config; no HM, no desktop
inheritance, no lib.mkForce; headless-optimised; SOPS set exactly once
- nixos/hardware-configuration.nix: copied from Config/hosts/server/
- nixos/secrets.yaml: copied SOPS-encrypted secrets from Config/hosts/server/
- nixos/modules/homeserver.nix: migrated; sops.defaultSopsFile removed
- nixos/modules/traefik-deployments.nix: migrated; sops.defaultSopsFile removed
- nixos/modules/dynu.nix: migrated; paths updated to ../scripts/
- nixos/scripts/monitor.py: dynu IP monitor Python script
- nixos/scripts/ddclient.conf: ddclient config template
- AGENTS.md: fix stale reference to deprecated desktop secrets path
Validated:
nix flake check -> all checks passed
nix build .#nixosConfigurations.server.config.system.build.toplevel \
--no-link -> success (nixos-system-server-26.11.20260910.8ce4ef6)
96 lines
3.3 KiB
Nix
96 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, ... }:
|
|
|
|
{
|
|
# 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"
|
|
"gitea/runner_token"
|
|
] (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/Brain";
|
|
|
|
# --- Excalidraw ---
|
|
EXCALIDRAW_DOMAIN = "excalidraw.roadtotech.me";
|
|
|
|
# --- Gitea ---
|
|
GITEA_DOMAIN = "gitea.roadtotech.me";
|
|
GITEA_SSH_DOMAIN = "gitea.roadtotech.me";
|
|
GITEA_SSH_PORT = "2223";
|
|
GITEA_AUTH_MIDDLEWARE = "https-redirect@docker";
|
|
GITEA_RUNNER_TOKEN = config.sops.placeholder."gitea/runner_token";
|
|
|
|
# --- 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";
|
|
};
|
|
};
|
|
}
|