-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathjustfile
144 lines (116 loc) · 4.44 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
host_name := `hostname`
nixpkgs_main_input := "unstable"
default:
@just --choose
# Build configuration flake for current host
build host=host_name:
mkdir -p /tmp/buildroot/ && nixos-rebuild build --flake ".#{{host}}"
# Build configuration flake for current host with debug output
build-debug host=host_name:
mkdir -p /tmp/buildroot/ && nixos-rebuild build --flake ".#{{host}}" --show-trace
# Build configuration flake for current host without network access
build-no-net host=host_name:
mkdir -p /tmp/buildroot/ && nixos-rebuild build --flake ".#{{host}}" --option binary-caches ''
# Build + switch configuration flake for current host
switch host=host_name:
mkdir -p /tmp/buildroot/ && nixos-rebuild switch{{ if env_var_or_default("VERBOSE", "false") == "true" { " -v" } else { "" } }} -j 4 --use-remote-sudo --flake ".#{{host}}"
# Build + switch configuration flake for current host without network access
switch-no-net host=host_name:
mkdir -p /tmp/buildroot/ && nixos-rebuild switch{{ if env_var_or_default("VERBOSE", "false") == "true" { " -v" } else { "" } }} --use-remote-sudo --flake ".#{{host}}" --option binary-caches ''
# Remove system build local output
clean:
unlink ./result || exit 0
# Rollback to previous working configuration(s)
rollback:
rollback
# Fix config, in case Emacs part is broken
fix-config:
emacs -q .
# Collect garbage
collect-garbage:
sudo nix-collect-garbage -d
# remove dead nix
remove-dead-nix:
deadnix .
# cleanup current devenv
devenv-cleanup:
rm -rf ${PWD}/.devenv ${PWD}/.direnv
rm -f ${PWD}/devenv.lock ${PWD}/.devenv.flake.nix ${PWD}/.pre-commit-config.yaml
touch .envrc
# cleanup and GC current devenv
devenv-cleanup-and-gc:
rm -rf ${PWD}/.devenv ${PWD}/.direnv
rm -f ${PWD}/devenv.lock ${PWD}/.devenv.flake.nix ${PWD}/.pre-commit-config.yaml
sudo nix-collect-garbage -d
touch .envrc
# Update flake inputs
flake-update-inputs: flake-update-inputs-nixpkgs-main \
flake-update-inputs-nur \
flake-update-inputs-home-manager \
flake-update-inputs-telega \
flake-update-inputs-nixos-aux \
flake-update-inputs-devenv \
flake-update-inputs-emacs \
flake-update-inputs-emacs-unpackaged \
flake-update-inputs-kitty-unpackaged \
flake-update-inputs-shell-unpackaged
# Update flake inputs, sans `devenv-src`
flake-update-inputs-sans-devenv: flake-update-inputs-nixpkgs-main \
flake-update-inputs-nur \
flake-update-inputs-home-manager \
flake-update-inputs-telega \
flake-update-inputs-nixos-aux \
flake-update-inputs-emacs \
flake-update-inputs-emacs-unpackaged \
flake-update-inputs-kitty-unpackaged \
flake-update-inputs-shell-unpackaged
# Update `unstable` flake input
flake-update-inputs-nixpkgs-main:
nix flake update {{nixpkgs_main_input}}
# Update `nur` flake input
flake-update-inputs-nur:
nix flake update nur
# Update `home-manager` flake input
flake-update-inputs-home-manager:
nix flake update home-manager
# Update `telega` flake input
flake-update-inputs-telega:
nix flake update telega
# Update nixos-related auxiliary inputs
flake-update-inputs-nixos-aux:
nix flake update nixos-hardware
nix flake update nixos-artwork
# Update `devenv-src` flake input
flake-update-inputs-devenv:
nix flake update devenv-src
# Update `emacs` flake input
flake-update-inputs-emacs:
nix flake update emacs
# Update `emacs` flake inputs for emacs unpackaged extensions
flake-update-inputs-emacs-unpackaged:
nix flake update emacs-org-bars
nix flake update emacs-highlight-sexp
nix flake update emacs-epithet
nix flake update emacs-easy-kill-extras
nix flake update emacs-consult-org-clock
nix flake update emacs-treesit-jump
nix flake update emacs-password-menu
# Update flake inputs for Kitty unpackaged extensions
flake-update-inputs-kitty-unpackaged:
nix flake update kitty-grab
nix flake update kitty-search
# Update flake inputs for unpackaged shell extensions
flake-update-inputs-shell-unpackaged:
nix flake update git-extra-commands
nix flake update pass-zsh-completion
nix flake update zsh-async
nix flake update zsh-fuzzy-search-and-edit
nix flake update zsh-reentry-hook
# Lint configuration flake(s)
check-config-flake:
flake-checker -n {{nixpkgs_main_input}}
# generate git log for `code-maat` consumption
maat-log:
git log --all --numstat --date=short --pretty=format:'--%h--%ad--%aN' --no-renames > maat.log
tagref:
tagref --file-sigil fn