-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathJustfile
86 lines (68 loc) · 2.31 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# just is a command runner, Justfile is very similar to Makefile, but simpler.
# TODO update hostname here!
hostname := "your-hostname"
# List all the just commands
default:
@just --list
############################################################################
#
# Darwin related commands
#
############################################################################
# TODO Feel free to remove this target if you don't need a proxy to speed up the build process
[group('desktop')]
darwin-set-proxy:
sudo python3 scripts/darwin_set_proxy.py
[group('desktop')]
darwin: darwin-set-proxy
nix build .#darwinConfigurations.{{hostname}}.system \
--extra-experimental-features 'nix-command flakes'
./result/sw/bin/darwin-rebuild switch --flake .#{{hostname}}
[group('desktop')]
darwin-debug: darwin-set-proxy
nix build .#darwinConfigurations.{{hostname}}.system --show-trace --verbose \
--extra-experimental-features 'nix-command flakes'
./result/sw/bin/darwin-rebuild switch --flake .#{{hostname}} --show-trace --verbose
############################################################################
#
# nix related commands
#
############################################################################
# Update all the flake inputs
[group('nix')]
up:
nix flake update
# Update specific input
# Usage: just upp nixpkgs
[group('nix')]
upp input:
nix flake update {{input}}
# List all generations of the system profile
[group('nix')]
history:
nix profile history --profile /nix/var/nix/profiles/system
# Open a nix shell with the flake
[group('nix')]
repl:
nix repl -f flake:nixpkgs
# remove all generations older than 7 days
# on darwin, you may need to switch to root user to run this command
[group('nix')]
clean:
sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 7d
# Garbage collect all unused nix store entries
[group('nix')]
gc:
# garbage collect all unused nix store entries(system-wide)
sudo nix-collect-garbage --delete-older-than 7d
# garbage collect all unused nix store entries(for the user - home-manager)
# https://github.com/NixOS/nix/issues/8508
nix-collect-garbage --delete-older-than 7d
[group('nix')]
fmt:
# format the nix files in this repo
nix fmt
# Show all the auto gc roots in the nix store
[group('nix')]
gcroot:
ls -al /nix/var/nix/gcroots/auto/