#!/usr/bin/env bash set -euo pipefail cd "$(dirname "$0")/.." # Tracked and new files in this worktree only, so nested worktrees are skipped. lint() { local tool=$1 pattern=$2 files files=$(git ls-files --cached --others --exclude-standard -- "$pattern") if [ -z "$files" ]; then echo "$tool: no files yet" return fi printf '%s\n' "$files" | tr '\n' '\0' | xargs -0 "$tool" } lint hadolint '*Dockerfile' lint shellcheck '*.sh' if [ ! -f executor/flake.nix ]; then echo "nix: no executor/flake.nix yet" exit 0 fi bash scripts/nix.sh sh -euc ' nix flake check --all-systems --no-update-lock-file path:./executor nix eval --raw --no-update-lock-file path:./executor#nixosConfigurations.executor.config.system.build.toplevel.drvPath echo '