-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
66 lines (44 loc) · 2.63 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
set shell := ["bash", "-uc"]
alias ya := yamato
alias yu := yukikaze
host := `hostname -s`
system := if os() == "macos" { "macos" } else { "nixos" }
default:
@echo "System: {{system}}, Host: {{host}}"
@{{just_executable()}} {{host}}
yamato use_nom="yes" details="yes": (_macos_rebuild "yamato" use_nom details)
nagato use_nom="yes" details="yes": (_macos_rebuild "nagato" use_nom details)
yukikaze use_nom="yes" details="yes": (_macos_rebuild "yukikaze" use_nom details)
poi use_nom="yes" details="yes": (_nixos_rebuild "poi" use_nom details)
taihou use_nom="yes" details="yes": (_nixos_rebuild "taihou" use_nom details)
_macos_rebuild hostname use_nom="yes" details="no": && (_macos_switch hostname details)
@{{ if use_nom == "yes" { "nom" } else { "nix" } }} build .#darwinConfigurations.{{hostname}}.system --extra-experimental-features 'nix-command flakes' {{ if details != "no" { "--show-trace" } else { "" } }}
_nixos_rebuild hostname use_nom="yes" details="no": && (_nixos_switch hostname details)
{{ if use_nom == "yes" { "nom" } else { "nix" } }} build .#nixosConfigurations.{{hostname}}.config.system.build.toplevel {{ if details != "no" { "--show-trace --verbose" } else { "" } }}
_macos_switch hostname details="no": _cleanup_rime_ls_build_prism_bin _cleanup_atuin_config
@./result/sw/bin/darwin-rebuild switch --flake .#{{hostname}} {{ if details != "no" { "--show-trace" } else { "" } }}
_nixos_switch hostname details="no": _cleanup_rime_ls_build_prism_bin _cleanup_atuin_config
@sudo nixos-rebuild switch --flake .#{{hostname}}
_cleanup_rime_ls_build_prism_bin:
-@rm $HOME/.local/share/rime-ls-files/build/flypy.prism.bin
_cleanup_atuin_config:
-@rm $HOME/.config/atuin/config.toml
up:
@nix flake update
push: commit
@git push
commit:
-@git add --all
-@git commit -m '...'
gc:
# garbage collect all unused nix store entries
@sudo nix store gc --debug
@sudo nix-collect-garbage --delete-old
nvim-clean:
-@rm $HOME/.config/nvim/init.lua
nvim-test: nvim-clean
@ln -s $HOME/.config/nvim/init-user.lua $HOME/.config/nvim/init.lua
fmt:
@nix fmt -- --exclude "./modules/shared/dotnix/development/languages/.vim-template.*.nix" --exclude "./modules/shared/dotnix/apps/.vim-template:*.nix" --exclude "./modules/darwin/dotnix/.vim-template:*.nix" --exclude "./modules/shared/dotnix/development/languages/.vim-template:*.nix" .
ci-fmt:
@nix fmt -- --exclude "./modules/shared/dotnix/development/languages/.vim-template.*.nix" --exclude "./modules/shared/dotnix/apps/.vim-template:*.nix" --exclude "./modules/darwin/dotnix/.vim-template:*.nix" --exclude "./modules/shared/dotnix/development/languages/.vim-template:*.nix" --check .