Nixos Dots
Run the script in scripts/nix-dev-check.sh to perform repository checks in one pass with readable status output.
Run The Workflow
Run from anywhere:
skills/nixos-dots/scripts/nix-dev-check.sh
Run read-only validation (no file edits):
skills/nixos-dots/scripts/nix-dev-check.sh --check
Pass extra arguments to nix flake check:
skills/nixos-dots/scripts/nix-dev-check.sh -- --keep-going
Script Behavior
Follow this sequence:
- •Resolve the repository root.
- •Print environment context (repo root, hostname, tool versions).
- •Validate hostname wiring hints (
hosts/<hostname>/default.nixand flake mentions). - •Parse changed
.nixfiles withnix-instantiate --parse. - •Run
alejandrain fix mode (default) or check mode (--check). - •Run
statix check --format errfmton changed files (or full repo with--lint-all). - •Run
git add -Ato stage all repository changes so flake evaluation includes new files. - •Check for untracked files and block flake checks by default (git flakes ignore untracked files).
- •Run
nix flake check --show-trace -L. - •Print a concise summary with pass/fail states.
Options
- •
--check: Runalejandra --check .instead of modifying files. - •
--skip-parse: Skip syntax parsing of changed.nixfiles. - •
--skip-lint: Skipstatixlint checks. - •
--lint-all: Runstatixagainst the full repository instead of changed files. - •
--skip-flake-check: Skipnix flake check. - •
--allow-untracked: Force flake check even when untracked files exist. - •
--no-auto-add: Skip the automaticgit add -Astep. - •
--help: Print usage. - •
--: Treat remaining args as additionalnix flake checkargs.
Use During Editing
Use default mode while iterating to auto-format before evaluation.
Use --check before commit if you want a non-mutating validation pass.
Use --lint-all before larger refactors when you want full-repository lint visibility.
The script stages all files automatically before flake checks; use --no-auto-add if you need to inspect unstaged changes first.
If untracked files still remain, add them to git before expecting nix flake check to pass (or use --allow-untracked when intentionally testing).
Fix reported syntax errors before rerunning full flake checks for faster feedback.