-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathjustfile
53 lines (37 loc) · 1.25 KB
/
justfile
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
_default:
@just --list
# nixos-rebuild test all hosts
test-all: (all "test")
# nixos-rebuild switch all hosts
switch-all: (all "switch")
build host:
@just {{ host }} build
test host:
@just {{ host }} test
switch host:
@just {{ host }} switch
repl host:
@just {{ host }} repl
# nixos-rebuild <op> all hosts
all op="test": (desk op) (htpc op) (pi op) (donix op)
desk op="test":
sudo nixos-rebuild {{ op }} --flake '.#desk' --fast
htpc op="test":
nixos-rebuild {{ op }} --flake '.#htpc' --target-host htpc --build-host htpc --use-remote-sudo --fast
pi op="test":
nixos-rebuild {{ op }} --flake '.#pi' --target-host pi --build-host pi --use-remote-sudo --fast
donix op="test":
nixos-rebuild {{ op }} --flake '.#donix' --target-host donix --build-host donix --use-remote-sudo --fast
# can only really be run on span, doesn't have test or repl, etc
span op="switch":
darwin-rebuild {{ op }} --flake '.#span'
routers:
nix build '.#routers'
wrt op="reload": routers
@just _deploy_router wrt {{ op }}
rpt op="reload": routers
@just _deploy_router rpt {{ op }}
_deploy_router name op:
if [[ "{{ op }}" == "restart" ]]; then ./result/bin/deploy-{{ name }}; \
else ./result/bin/deploy-{{ name }} --reload; \
fi