-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
46 lines (37 loc) · 980 Bytes
/
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
default:
just format
just diff
just switch-quiet
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:
#!/usr/bin/env bash
set -euo pipefail
nix flake lock --update-input nvim
darwin-rebuild switch --flake . &>nix-switch.log || (
cat nix-switch.log | grep --color error && false)
switch-loud:
nix flake lock --update-input nvim
darwin-rebuild switch --flake .
commit:
#!/usr/bin/env bash
set -euo pipefail
if ! git diff --quiet || ! git diff --quiet --cached; then
gen=$(darwin-rebuild --list-generations | grep current)
git commit -am "$gen"
git push --quiet
else
echo "No changes to commit."
fi
update:
nix flake update