-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjustfile
More file actions
44 lines (35 loc) · 963 Bytes
/
justfile
File metadata and controls
44 lines (35 loc) · 963 Bytes
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
switch host:
just format
just diff
just switch-loud {{ host }}
just commit
format:
alejandra --quiet .
diff:
#!/usr/bin/env bash
set -euo pipefail
if ! git diff --quiet || ! git diff --quiet --cached; then
git --no-pager diff -U0
git --no-pager diff --cached -U0
else
echo "No changes detected."
fi
switch-quiet host:
#!/usr/bin/env bash
set -euo pipefail
sudo darwin-rebuild switch --flake .#{{ host }} &>nix-switch.log || (
cat nix-switch.log | grep --color error && false)
switch-loud host:
sudo darwin-rebuild switch --flake .#{{ host }}
commit:
#!/usr/bin/env bash
set -euo pipefail
if ! git diff --quiet || ! git diff --quiet --cached; then
gen=$(sudo darwin-rebuild --list-generations | grep current)
git commit -am "$gen"
git push --quiet
else
echo "No changes to commit."
fi
update:
nix flake update