-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justfile
98 lines (79 loc) · 2.19 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
86
87
88
89
90
91
92
93
94
95
96
97
98
alias sh := switch-home
alias sn := switch-nixos
alias bh := build-home
alias bn := build-nixos
alias s := switch
alias b := build
alias ls := show
alias u := update
# Run full switch: home + system
switch: switch-nixos switch-home
# Build home and switch
switch-home:
igloo switch home
# Build system and switch
switch-nixos:
igloo switch nixos
# Build home
build-home:
igloo build home
# Build system
build-nixos:
igloo build nixos
# Build all
build: build-nixos build-home
# Build WSL system tarball
build-wsl system="smaug":
@mkdir -p build
@echo 'Building "{{ system }}" WSL system tarball'
sudo nix run .#nixosConfigurations.{{ system }}-wsl.config.system.build.tarballBuilder
@mv -v nixos-wsl.tar.gz \
build/nixos-wsl-{{ system }}_\
"$(git rev-parse --abbrev-ref HEAD)"-\
"$(git describe --always --dirty --tags --abbrev=7)".tar.gz
# Build WSL system tarball on non-flake enabled instances
build-wsl-noflake system="smaug":
@mkdir -p build
@echo 'Building "{{ system }}" WSL system tarball'
nix-build nix/default.nix \
-A nixosConfigurations.{{ system }}-wsl.config.system.build.tarballBuilder \
&& sudo ./result/bin/nixos-wsl-tarball-builder
@mv -v nixos-wsl.tar.gz \
build/nixos-wsl-{{ system }}_\
"$(git rev-parse --abbrev-ref HEAD)"-\
"$(git describe --always --dirty --tags --abbrev=7)".tar.gz
# Build GitHub README
build-readme:
sh .github/make-readme.sh
# Show flake outputs
show:
nix flake show --allow-import-from-derivation
# Show flake outputs with `nix-schema`
show-schema:
nix-schema flake show
# Show TODO-s and FIXME-s:
todo:
@rg -g '!Justfile' TODO
@rg -g '!Justfile' FIXME
# Update flake inputs
update:
igloo update
# Run flake checks
check:
auto-follow --check ./flake.lock # TODO: add to pre-commit instead
nix flake check
# Run pre-commit checks
pre-commit:
pre-commit run
# Check code
check-code:
pre-commit run --all-files
# Run full clean: Nix store + repo
clean: clean-result clean-store
# Clean repo from results links
clean-result:
find . -name result -delete
# Clean Nix store
clean-store:
nix store gc
nix store optimise