-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
50 lines (39 loc) · 1.66 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
HOST := `hostname`
USER := `echo $USER`
# Default recipe to display help information
[private]
default:
@just --list
[private]
@rebuild-pre:
git add .
(cd ../nixos-secrets && git fetch && git rebase) || true
nix flake update nixos-secrets
# Rebuilds both NixOS & Home Manager
sync: ns hm
# Rebuilds NixOS
ns host=HOST: rebuild-pre
sudo nixos-rebuild --flake .#{{ host }} switch
# Rebuilds Home Manager
hm host=HOST user=USER: && hm-post
home-manager switch --flake .#{{ user }}@{{ host }}
# Runs rebuild in test and has both shows-trace and eval-cache false
ns-trace host=HOST: rebuild-pre
sudo nixos-rebuild test --show-trace --option eval-cache false --flake .#{{ host }}
# Has both shows-trace and eval-cache false
hm-trace host=HOST user=USER: && hm-post
home-manager switch --show-trace --option eval-cache false --flake .#{{ user }}@{{ host }}
# Updates the flake and rebuilds NixOS
@ns-update: && (ns HOST)
nix flake update
# Rekeys the provided file with the .sops.yaml config
@rekey secret:
cd ../nixos-secrets/sops && (sops updatekeys -y {{ secret }} && git add -u && (git commit -m "chore: rekey {{ secret }}" || true) && git push)
# Garbage Collect for NixOS
@gc: && ns
nix-collect-garbage --delete-old
[private]
@hm-post:
pgrep Hyprland &> /dev/null && echo "Reloading hyprland" && hyprctl reload &> /dev/null
pgrep .waybar-wrapped &> /dev/null && echo "Restarting waybar" && killall .waybar-wrapped && echo "Running waybar" && waybar &> /dev/null & disown
pgrep Hyprland &> /dev/null && echo "Reapplying background from stylix via swaybg" && echo "Running ~/.swaybg-stylix" && ~/.swaybg-stylix &> /dev/null & disown