-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
54 lines (43 loc) · 1.42 KB
/
Copy pathjustfile
File metadata and controls
54 lines (43 loc) · 1.42 KB
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
# Ensure nix and darwin-rebuild are found even when `just` runs recipes
# with a bare `sh` that hasn't sourced the nix profile.
export PATH := "/run/current-system/sw/bin:/nix/var/nix/profiles/default/bin:" + env_var('PATH')
alias r := rebuild
alias b := build
alias u := update
alias ui := update-input
alias c := check
default:
@just --choose
# Apply the darwin configuration for this host
rebuild *args="":
sudo darwin-rebuild switch \
--flake "{{ justfile_directory() }}#macbook" \
{{ args }}
# Build without activating
build *args="":
darwin-rebuild build \
--flake "{{ justfile_directory() }}#macbook" \
{{ args }}
# First-time bootstrap (when darwin-rebuild isn't on PATH yet)
bootstrap:
sudo nix run github:nix-darwin/nix-darwin -- switch \
--flake "{{ justfile_directory() }}#macbook"
# Update all flake inputs
update:
nix flake update --flake "{{ justfile_directory() }}"
# Update a single flake input
update-input input:
nix flake update {{ input }} --flake "{{ justfile_directory() }}"
# Sanity-check the flake
check:
nix flake check "{{ justfile_directory() }}" --no-build
# Show flake outputs
show:
nix flake show "{{ justfile_directory() }}"
# Garbage-collect older generations
gc:
sudo nix-collect-garbage --delete-older-than 7d
nix-collect-garbage --delete-older-than 7d
# Rollback to the previous generation
rollback:
sudo darwin-rebuild rollback