-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (24 loc) · 873 Bytes
/
Makefile
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
############################################################################
#
# Nix commands related to the local machine
#
############################################################################
KEEP?=10
deploy:
nh os switch --ask .
test:
nixos-rebuild test --flake . --use-remote-sudo
debug:
nixos-rebuild switch --flake . --use-remote-sudo --show-trace --verbose
update:
nix flake update
history:
nix profile history --profile /nix/var/nix/profiles/system
keep:
sudo nix-env --delete-generations +${KEEP} --profile /nix/var/nix/profiles/system
sudo nix-env --delete-generations +${KEEP} --profile ~/.local/state/nix/profiles/home-manager
gc:
# remove all generations older than 7 days
sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 7d
# garbage collect all unused nix store entries
sudo nix store gc --debug