Skip to content

Justfile Recipes

This reference documents all justfile recipes available in the infra repository. Run just --list to see available recipes or just help for usage information.

GroupCountPurpose
activation4System/home configuration activation
nix15Core nix operations
terraform3Terraform/terranix infrastructure
clan7Machine building and testing
docs17Documentation site management
diagrams3Typst diagram compilation
containers7Container image building
secrets14SOPS secrets management
sops8SOPS key management
CI/CD30CI/CD operations and caching
nix-home-manager4Home-manager bootstrap
nix-darwin3Darwin bootstrap
nixos4NixOS operations

Unified activation commands using nh via flake apps. All recipes accept nh flags: --dry (preview), --ask (confirm), --verbose.

RecipeArgumentsDescriptionCI-tested
activate*FLAGSAuto-detect platform and activate current machineNo
activate-darwinhostname *FLAGSActivate darwin configurationNo
activate-oshostname *FLAGSActivate NixOS configurationNo
activate-homeusername *FLAGSActivate home-manager configurationNo

Examples:

Terminal window
# Preview changes before applying
just activate --dry
# Apply with confirmation prompt
just activate --ask
# Activate specific darwin host
just activate-darwin stibnite
# Activate home-manager for user
just activate-home crs58 --dry

Core nix operations for building, checking, and managing the flake.

RecipeArgumentsDescriptionCI-tested
flake-info-Print nix flake inputs and outputsNo
lint-Lint nix files with pre-commitNo
dev-Manually enter dev shellNo
clean-Remove build output link (no garbage collection)No
buildprofileBuild nix flake (runs lint and check first)No
debug-buildpackageBuild experimental debug package with nomNo
debug-list-List all available debug packagesNo
check-Run nix flake check (full, including VM tests)Yes
check-fastsystemFast checks excluding heavy VM integration testsNo
verify-Verify system configuration builds after updatesNo
bisect-nixpkgs-Bisect nixpkgs commits (automatic mode)No
bisect-nixpkgs-manualcommandBisect nixpkgs commits (manual mode)No
bootstrap-shell-Shell with bootstrap dependenciesNo
update-Update all nix flake inputsNo
update-packagepackageUpdate a package using its updateScriptNo

CI-tested recipes: check is called by the flake-validation CI job.

Terraform/terranix infrastructure management for cloud resources. Recipes manage Hetzner VPS infrastructure through terranix-generated configurations.

RecipeArgumentsDescriptionCI-tested
terraform*ARGSRun terraform apply (removes stale lockfile first)No
terraform-plan*ARGSRun terraform plan onlyNo
terraform-destroy*ARGSRun terraform destroyNo

Note: These recipes stop the rosetta-manager service before running to avoid conflicts, and remove stale .terraform.lock.hcl files to sync with nix-provided providers.

Commands for clan-based machine management.

RecipeArgumentsDescriptionCI-tested
test-Run all tests (nix flake check)No
test-quick-Run fast validation tests (nix-unit)No
test-integration-Run VM integration tests (Linux only)No
build-all-Build all machine configurations using nomNo
build-machinemachineBuild a specific machine configurationNo
clan-show-Show flake outputsNo
clan-metadata-Show flake metadataNo

Documentation site management using Starlight and Cloudflare Workers.

RecipeArgumentsDescriptionCI-tested
install-Install workspace dependencies (bun install)No
docs-dev-Start documentation development serverNo
docs-build-Build the documentation siteNo
docs-preview-Preview the built documentation siteNo
docs-format-Format documentation code with BiomeNo
docs-lint-Lint documentation code with BiomeNo
docs-check-Check and fix documentation code with BiomeNo
docs-linkcheck-Validate internal and external linksNo
docs-test-Run all documentation testsYes
docs-test-unit-Run documentation unit testsYes
docs-test-e2e-Run documentation E2E testsYes
docs-test-coverage-Generate documentation test coverage reportYes
docs-deploy-previewbranchDeploy to Cloudflare Workers (preview)Yes
docs-deploy-production-Deploy to Cloudflare Workers (production)Yes
docs-deployments-List recent Cloudflare deploymentsNo
docs-tail-Tail live logs from Cloudflare WorkersNo
docs-versionslimitList recent Cloudflare versionsNo

CI-tested recipes: docs-test-* recipes are called by the typescript CI job. docs-deploy-* recipes are called by preview-docs-deploy and production-docs-deploy jobs.

Typst diagram compilation and optimization for documentation.

RecipeArgumentsDescriptionCI-tested
diagrams-build-Compile all typst diagrams to SVG and optimize for webNo
diagrams-compilenameCompile a single typst diagram (without optimization)No
diagrams-watch-Watch typst diagrams for changes and recompileNo

Note: diagrams-build is called as a dependency by docs-build, docs-linkcheck, docs-deploy-preview, and docs-deploy-production.

Container image building and testing.

RecipeArgumentsDescriptionCI-tested
build-containercontainer arch?Build container for specified architectureNo
build-multiarchcontainerBuild container for both aarch64 and x86_64No
load-container-Load container image from result into dockerNo
load-native-Load native architecture from multi-arch buildNo
test-containerbinaryTest container by running binary with —helpNo
container-allcontainer binary arch?Complete workflow: build, load, testNo
container-all-multiarchcontainer binaryMulti-arch workflow: build both, load native, testNo

SOPS-based secrets management.

RecipeArgumentsDescriptionCI-tested
scan-secrets-Scan repository for hardcoded secrets (full history)No
scan-staged-Scan staged changes for secrets (pre-commit)No
show-Show existing secrets using sopsNo
seed-dotenv-Create empty dotenv from templateNo
export-Export unique secrets to dotenv formatNo
check-secrets-Check secrets are available in sops environmentNo
get-kubeconfig-Save KUBECONFIG to file from sopsNo
hash-encryptsource_file user?Hash-encrypt file and store in secrets directoryNo
verify-hashoriginal_file secret_fileVerify hash integrity of encrypted fileNo
edit-secretfileEdit a sops encrypted fileNo
new-secretfileCreate a new sops encrypted fileNo
get-shared-secretkeyShow specific secret value from shared secretsNo
run-with-secrets+commandRun command with all shared secrets as env varsNo
validate-secrets-Validate all sops encrypted files can be decryptedNo

Note: CI uses nix run nixpkgs#gitleaks directly rather than just scan-secrets.

SOPS key management and rotation.

RecipeArgumentsDescriptionCI-tested
sops-extract-keyskey?Extract key details from BitwardenNo
sops-update-yaml-Update .sops.yaml with keys from BitwardenNo
sops-deploy-host-keyhostDeploy host key from Bitwarden to /etc/sshNo
sops-validate-correspondences-Validate SOPS key correspondencesNo
sops-sync-keys*FLAGSRegenerate ~/.config/sops/age/keys.txtNo
sops-rotate-Full key rotation workflow (interactive)No
update-all-keys-Update keys for all encrypted filesNo
sops-load-agent-Load SOPS launchd agent (darwin only)No

CI/CD operations, caching, and release management.

RecipeArgumentsDescriptionCI-tested
ci-run-watchworkflow?Trigger CI workflow and wait for resultNo
ci-statusworkflow?View latest CI run statusNo
ci-logsworkflow?View latest CI run logsNo
ci-logs-failedworkflow?View only failed logs from latest CI runNo
ci-show-outputssystem?List categorized flake outputsNo
ci-build-localcategory? system?Build all flake outputs locally with nomNo
ci-build-categorysystem category config?Build specific category for CI matrixYes
ci-cache-categorysystem category config?Build and cache category with cachixNo
ci-validateworkflow? run_id?Validate latest CI run comprehensivelyNo
ci-debug-jobworkflow? job_name?Debug specific failed jobNo
ghsecretsrepo?Update GitHub secrets from sopsNo
list-workflows-List available workflows (via act)No
test-flake-workflow-Execute ci.yaml workflow locally via actNo
ratchet-pin-Pin GitHub Actions workflow versions to hashesNo
ratchet-unpin-Unpin workflow versions to semantic valuesNo
ratchet-update-Update GitHub Actions to latest versionsNo
ratchet-upgrade-Upgrade GitHub Actions across major versionsNo
cache-rosetta-builder-Push nix-rosetta-builder VM image to cachixNo
check-rosetta-cache-Check if rosetta-builder image is cachedNo
cache-linux-packagepackageBuild Linux package and push to cachixNo
test-cachix-Test cachix push/pull with simple derivationNo
cache-ci-outputssystem?Build all CI outputs and push to cachixNo
cache-darwin-system-Build darwin system and push to cachixNo
cache-overlay-packagessystemCache all overlay packages for systemYes
list-packages-List all packages in packages/ directoryNo
list-packages-json-List packages in JSON format for CI matrixYes
validate-packagepackageValidate package structureNo
test-packagepackageTest package (install, tests, build)Yes
preview-versiontarget? package?Preview semantic-release versionYes
release-packagepackage dry_run?Release package using semantic-releaseNo

CI-tested recipes:

  • ci-build-category is called by the nix CI job matrix
  • cache-overlay-packages is called by the cache-overlay-packages CI job
  • list-packages-json is called by the set-variables CI job
  • test-package is called by the typescript CI job
  • preview-version is called by the preview-release-version CI job

Home-manager bootstrap recipes for initial setup.

RecipeArgumentsDescriptionCI-tested
home-manager-bootstrap-buildprofile?Bootstrap build home-manager (before installed)No
home-manager-bootstrap-switchprofile?Bootstrap switch home-manager (before installed)No
home-manager-buildprofile?Build home-manager with flakeNo
home-manager-switchprofile?Switch home-manager with flakeNo

Note: Use activate-home for normal operations. These recipes are for bootstrap scenarios before home-manager is installed.

Darwin bootstrap recipes for initial setup.

RecipeArgumentsDescriptionCI-tested
darwin-bootstrapprofile?Bootstrap nix-darwin with flakeNo
darwin-buildprofile?Build darwin from flakeNo
darwin-testprofile?Test darwin from flakeNo

Note: Use activate-darwin for normal operations. These recipes are for bootstrap scenarios before nix-darwin is installed.

NixOS operations and bootstrap.

RecipeArgumentsDescriptionCI-tested
nixos-bootstrapdestination username publickeyBootstrap NixOS (physical partitioning)No
nixos-vm-syncuser destinationCopy flake to VM via rsyncNo
nixos-buildprofile?Build NixOS from flakeNo
nixos-testprofile?Test NixOS from flakeNo

Warning: nixos-bootstrap performs destructive disk operations. Only use for initial physical machine setup.

Note: Use activate-os for normal NixOS activation.