My nix-darwin and NixOS config
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: correct variable

+23 -9
+22 -8
hooks/pre-commit
··· 19 19 REPO_ROOT="$(git rev-parse --show-toplevel)" 20 20 cd "$REPO_ROOT" 21 21 22 - # Read staged files into arrays by extension 23 - mapfile -t NIX_FILES < <(git diff --cached --name-only --diff-filter=ACM | grep '\.nix$' || true) 24 - mapfile -t SH_FILES < <(git diff --cached --name-only --diff-filter=ACM | grep '\.sh$' || true) 25 - mapfile -t RS_FILES < <(git diff --cached --name-only --diff-filter=ACM | grep '\.rs$' || true) 26 - mapfile -t TOML_FILES < <(git diff --cached --name-only --diff-filter=ACM | grep '\.toml$' || true) 27 - mapfile -t MD_FILES < <(git diff --cached --name-only --diff-filter=ACM | grep '\.md$' || true) 28 - mapfile -t PRETTIER_FILES < <(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(json|jsonc|yaml|yml|css|js|html)$' || true) 22 + # Collect staged files matching an extended-regex pattern into a global array. 23 + # Uses while-read rather than mapfile for bash 3 compatibility (macOS ships 24 + # bash 3; mapfile requires bash 4+). local -n (namerefs) also requires 4.3+ 25 + # so we accept a fixed global array name _FILES and copy out as needed. 26 + _staged_files() { 27 + _FILES=() 28 + while IFS= read -r line; do 29 + [[ -n "$line" ]] && _FILES+=("$line") 30 + done < <(git diff --cached --name-only --diff-filter=ACM | grep -E "$1" || true) 31 + } 32 + 33 + _staged_files '\.nix$'; NIX_FILES=("${_FILES[@]}") 34 + _staged_files '\.sh$'; SH_FILES=("${_FILES[@]}") 35 + _staged_files '\.rs$'; RS_FILES=("${_FILES[@]}") 36 + _staged_files '\.toml$'; TOML_FILES=("${_FILES[@]}") 37 + _staged_files '\.md$'; MD_FILES=("${_FILES[@]}") 38 + _staged_files '\.(json|jsonc|yaml|yml|css|js|html)$'; PRETTIER_FILES=("${_FILES[@]}") 29 39 30 40 FAILED=0 31 41 ··· 78 88 for root in "${!seen_roots[@]}"; do 79 89 echo "→ rustfmt: formatting $root..." 80 90 cargo fmt --manifest-path "$root/Cargo.toml" 2>/dev/null 91 + 81 92 # Re-stage any .rs files under this root 82 - mapfile -t ROOT_RS_FILES < <(printf '%s\n' "${RS_FILES[@]}" | grep "^$root/") 93 + ROOT_RS_FILES=() 94 + while IFS= read -r line; do 95 + [[ -n "$line" ]] && ROOT_RS_FILES+=("$line") 96 + done < <(printf '%s\n' "${RS_FILES[@]}" | grep "^$root/" || true) 83 97 [ "${#ROOT_RS_FILES[@]}" -gt 0 ] && git add "${ROOT_RS_FILES[@]}" 84 98 echo " ✓ rustfmt applied and re-staged" 85 99
+1 -1
modules/caddy.nix
··· 69 69 # Explicitly disable HTTP challenge — DNS-01 only. 70 70 webroot = null; 71 71 credentialFiles = { 72 - "CF_DNS_API_TOKEN_FILE" = config.sops.secrets."cloudflare-acme.env".path; 72 + "CF_DNS_API_TOKEN" = config.sops.secrets."cloudflare-acme.env".path; 73 73 }; 74 74 # Emit verbose lego output so failures are diagnosable in the journal. 75 75 enableDebugLogs = true;