Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
67 lines (56 loc) · 2.02 KB
/
Copy pathjustfile
File metadata and controls
67 lines (56 loc) · 2.02 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
57
58
59
60
61
62
63
64
65
66
67
set positional-arguments
# Deploy - current host (no arg) or remote host over SSH
deploy host="":
@if [ -z "{{host}}" ]; then \
if [ "$(uname -s)" = "Darwin" ]; then \
nh darwin switch . -H jp-mbp; \
else \
nh os switch .; \
fi; \
else \
case "{{host}}" in \
obox) \
nh os switch .#obox --target-host nikhil@obox --build-host nikhil@obox --elevation-strategy passwordless ;; \
bbox) \
nh os switch .#bbox --target-host nikhil@bbox --build-host nikhil@bbox --elevation-strategy passwordless ;; \
mach) \
nh os switch .#mach --target-host niksingh710@mach --elevation-strategy passwordless ;; \
*) \
nh os switch .#{{host}} --target-host nikhil.singh@{{host}} --elevation-strategy passwordless ;; \
esac; \
fi
# Deploy home-manager only (run on the target machine after SSH)
home user="nikhil":
nh home switch .#{{user}}
# Dry build (eval only, no compilation)
build host:
@case "{{host}}" in \
jp-mbp) nh darwin build . -H jp-mbp --dry ;; \
*) nh os build .#{{host}} --dry ;; \
esac
# Build ISO
iso:
nix build .#iso
# Fetch ZMK firmware from semi710/zmk-config CI (waits for in-progress run; downloads to zmk/out/)
zmk:
rid=$(gh run list -R semi710/zmk-config -w "Build ZMK Firmware" -L1 --json databaseId -q '.[0].databaseId') && \
gh run watch "$rid" --exit-status -i 5 && \
gh run download "$rid" -R semi710/zmk-config -n firmware -D zmk/out
# Build ZMK firmware locally via nix
zmk-build:
nix build .#zmk
# Serve docs locally (http://0.0.0.0:<random-port>)
doc:
PORT=$(shuf -i 8000-9000 -n 1) && echo "→ http://0.0.0.0:$PORT" && nix run .#docs -- serve -a 0.0.0.0:$PORT --quiet 2>&1 | grep -v "│"
# Format nix files
fmt:
treefmt
# Update flake lock
update:
nix flake update
# Check flake (eval all configs)
check:
nix flake check
# Garbage collect - all profiles (needs sudo)
gc:
sudo nh clean all