-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
56 lines (44 loc) · 1.99 KB
/
justfile
File metadata and controls
56 lines (44 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
set shell := ["bash", "-eu", "-o", "pipefail", "-c"]
set positional-arguments
tooling_flake := "path:."
default:
@just --list
# Format tracked Nix files.
fmt:
nix develop '{{ tooling_flake }}' -c bash -euo pipefail -c 'mapfile -t files < <(rg --files -g "*.nix"); if [[ "${#files[@]}" -eq 0 ]]; then exit 0; fi; nixfmt "${files[@]}"'
# Check Nix formatting only.
fmt-check:
nix develop '{{ tooling_flake }}' -c bash -euo pipefail -c 'mapfile -t files < <(rg --files -g "*.nix"); if [[ "${#files[@]}" -eq 0 ]]; then exit 0; fi; nixfmt --check "${files[@]}"'
# Run lint checks.
lint: lint-nix lint-shell
@echo "✅ lint passed"
# Lint Nix configs (statix + deadnix + formatting check).
lint-nix:
nix develop '{{ tooling_flake }}' -c statix check .
nix develop '{{ tooling_flake }}' -c bash -euo pipefail -c 'mapfile -t files < <(rg --files -g "*.nix"); if [[ "${#files[@]}" -eq 0 ]]; then exit 0; fi; deadnix --fail --no-underscore "${files[@]}"'
nix develop '{{ tooling_flake }}' -c bash -euo pipefail -c 'mapfile -t files < <(rg --files -g "*.nix"); if [[ "${#files[@]}" -eq 0 ]]; then exit 0; fi; nixfmt --check "${files[@]}"'
# Lint shell scripts.
lint-shell:
nix develop '{{ tooling_flake }}' -c shellcheck scripts/*.sh
# Build package.
build:
nix build -L '{{ tooling_flake }}#codex'
# Lightweight validation for the automated updater workflow.
validate-update: fmt-check lint
nix build --dry-run -L '{{ tooling_flake }}#codex'
@echo "✅ update validation passed"
# Run package with forwarded args.
run *args='--help':
nix run '{{ tooling_flake }}#codex' -- {{ args }}
# Update version/hash pins in package.nix.
update version="":
if [[ -n "{{ version }}" ]]; then \
./scripts/update-package.sh --version "{{ version }}"; \
else \
./scripts/update-package.sh; \
fi
# Full validation gate.
check: fmt-check lint
nix flake check --all-systems '{{ tooling_flake }}'
nix run '{{ tooling_flake }}#codex' -- --version
@echo "✅ check passed"