-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
44 lines (31 loc) · 1.21 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
set shell := ["sh", "-c"]
set quiet
currentUser := `whoami`
currentHost := `hostname`
default:
just --choose || just --list
switch host=currentHost user=currentUser: (rebuild "switch" host user)
rebuild method="switch" host="{{ currentHost }}" user="{{ currentUser }}": (rebuild-system method host) (rebuild-home user host)
rebuild-system method="switch" host=currentHost: format
sudo nixos-rebuild {{method}} --flake '.#{{ host }}'
rebuild-home user=currentUser host=currentHost: format
home-manager switch --flake '.#{{ user }}@{{ host }}'
# Update specific inputs and rebuild
update: update-only && rebuild
# Update only some specific flake inputs
update-only:
@nix flake lock --update-input nixpkgs --update-input home-manager --update-input nixpkgs-unstable --update-input firefox-extensions
# Update all flake inputs
update-all: && rebuild
@nix flake update
format:
echo "Formatting ..."
alejandra . &> alejandra.log || (echo "Formatting failed! Error:"; cat alejandra.log | sed 's/^/ /'; exit 1)
check: format
nix flake check
clean-light:
nix-collect-garbage
nix-store --optimise -v
clean: && clean-light
nix-env --delete-generations +10
home-manager expire-generations 5d