-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
51 lines (40 loc) · 1.23 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
# HACK(asm,2023-11-08): use `scutil` here to avoid having to deal with dynamic local hostnames
# (e.g. those set by the AWS reverse IP thing)
HOSTNAME := `scutil --get LocalHostName`
# list available tasks
help:
@just --list
@echo ""
@echo "Variables:"
@echo " HOSTNAME: ${HOSTNAME}"
# run a home-manager build for the current host
build:
@echo "Building ${HOSTNAME}"
nix build .#homeConfigurations.${HOSTNAME}.activationPackage
# activate the current home-manager generation
activate:
@echo "Home-manager switching ${HOSTNAME}"
./result/activate
alias home := switch
# run a home-manager switch for the current host
switch: build activate
# run a home-manager build for the current host with debug tracing
debug:
@echo "Home-manager debug switching ${HOSTNAME}"
nix build .#homeConfigurations.${HOSTNAME}.activationPackage --show-trace --verbose
# show the history of the current profile
history:
home-manager generations
# update the flake.lock
update:
nix flake update
# clean up nix store
gc:
sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 7d
sudo nix store gc --debug
# format files
fmt:
nix fmt
# clean up build artifacts
clean:
rm -rf result