Something went wrong. Try again.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859# homelab-iac justfile# Requires: just, op (1Password CLI), tofu, colmena, nix, ssh
set shell := ["bash", "-euo", "pipefail", "-c"]
# Default: list all recipesdefault: @just --list
# ── Nix ────────────────────────────────────────────────────────────────────
# Evaluate all NixOS configs and check formattingcheck: cd nix && nix flake check --no-build
# Format Nix and OpenTofu filesfmt: cd nix && nix fmt || true cd terraform && tofu fmt
# ── OpenTofu (credentials injected from 1Password) ─────────────────────────
@tf +args: source .env && tofu -chdir=terraform {{args}}
# Show planned infrastructure changesinfra-plan: just tf plan
# Apply infrastructure changesinfra-apply: just tf apply
# Destroy all infrastructure (prompts for confirmation)infra-destroy: just tf destroy
# Show current infrastructure stateinfra-show: just tf show
# ── NixOS Deployment ───────────────────────────────────────────────────────
# Deploy NixOS config to all hostsdeploy *args: cd nix && op run --env-file="./.op-env" --no-masking -- colmena apply --impure {{args}}
# Deploy NixOS config to a specific host, e.g.: just deploy-host mediadeploy-host host: just deploy --on {{ host }}
# ── DNS ───────────────────────────────────────────────────────-------------
dns-plan: cd dns && dnscontrol preview --creds '!op inject -i creds.json.tpl'
dns-apply: cd dns && dnscontrol push --creds '!op inject -i creds.json.tpl'