-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
590 lines (512 loc) · 17 KB
/
Taskfile.yaml
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
---
version: "3"
env:
XDG_CONFIG_HOME: "{{.HOME}}/.config"
XDG_CACHE_HOME: "{{.HOME}}/.cache"
XDG_DATA_HOME: "{{.HOME}}/.local/share"
XDG_RUNTIME_DIR: "{{.HOME}}/tmp/xdg_runtime"
################################################################################
tasks:
ensure_xdg:
desc: Ensure the XDG locations are present
silent: true
internal: true
cmds:
- mkdir -p {{.XDG_CONFIG_HOME}}
- mkdir -p {{.XDG_CACHE_HOME}}
- mkdir -p {{.XDG_DATA_HOME}}
- mkdir -p {{.XDG_RUNTIME_DIR}}
################################################################################
## Alacritty
alacritty:up:
desc: Configures the Alacritty terminal
cmds:
- ln -sfn {{.ROOT_DIR}}/alacritty {{.XDG_CONFIG_HOME}}/alacritty
# - git clone https://github.com/alacritty/alacritty.git {{.HOME}}/tmp/alacritty
# - tic -xe alacritty,alacritty-direct {{.HOME}}/tmp/alacritty/extra/alacritty.info
# - rm -rf {{.HOME}}/tmp/alacritty
- defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO
- defaults -currentHost write -globalDomain AppleFontSmoothing -int 2
alacritty:down:
desc: Removes Alacritty configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/alacritty
asdf:up:
desc: Configures the ASDF SDK manager
cmds:
- ln -sfn {{.ROOT_DIR}}/asdf {{.XDG_CONFIG_HOME}}/asdf
asdf:down:
desc: Removes the ASDF configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/asdf
################################################################################
# Ansible
# ansible:up:
# desc: Configures Ansible
# cmds:
# - pip3 install -U ansible
#
# ansible:down:
# desc: Removes Ansible configuration
# cmds:
# - pip3 uninstall -y ansible
################################################################################
# Bash
bash:up:
desc: Configures the Bash shell
cmds:
- ln -sfn {{.ROOT_DIR}}/bash/.bash_profile {{.HOME}}/.bash_profile
- ln -sfn {{.ROOT_DIR}}/bash/.bashrc {{.HOME}}/.bashrc
bash:down:
desc: Removes Bash configuration
cmds:
- rm {{.HOME}}/.bash_profile
- rm {{.HOME}}/.bashrc
################################################################################
# Binaries
bin:up:
desc: Provisions local binaries
vars:
BIN_HOME: "{{.HOME}}/.local/bin"
cmds:
- mkdir -p {{.BIN_HOME}}
- ln -sf {{.ROOT_DIR}}/bin/* {{.BIN_HOME}}
################################################################################
# Coursier
coursier:up:
cmds:
- curl -fL https://github.com/VirtusLab/coursier-m1/releases/latest/download/cs-aarch64-apple-darwin.gz | gzip -d > /tmp/cs
- chmod +x /tmp/cs
- (xattr -d com.apple.quarantine /tmp/cs || true)
- /tmp/cs setup
status:
- test -d {{.HOME}}/Library/Application\ Support/Coursier/bin
coursier:down:
cmds:
- rm -rf {{.HOME}}/Library/Caches/Coursier
- rm -rf {{.HOME}}/Library/Application\ Support/Coursier
################################################################################
# Direnv
direnv:up:
desc: Configures Direnv
cmds:
- ln -sfn {{.ROOT_DIR}}/direnv {{.XDG_CONFIG_HOME}}/direnv
direnv:down:
desc: Removes Direnv configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/direnv
################################################################################
# Docker
docker:up:
desc: Configures the Docker engine
cmds:
- ln -sfn {{.ROOT_DIR}}/docker {{.XDG_CONFIG_HOME}}/docker
- mkdir -p {{.XDG_CONFIG_HOME}}/docker/cli-plugins
- ln -sfn /opt/homebrew/opt/docker-buildx/bin/docker-buildx {{.XDG_CONFIG_HOME}}/docker/cli-plugins/docker-buildx
docker:down:
desc: Removes Docker configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/docker
################################################################################
# FD
fd:up:
desc: Configures fd
cmds:
- ln -sfn {{.ROOT_DIR}}/fd {{.XDG_CONFIG_HOME}}/fd
fd:down:
desc: Removes FD configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/fd
################################################################################
# FZF
fzf:up:
desc: Configures FZF fuzzy finder
vars:
FZF_HOME:
sh: brew --prefix
cmds:
- ln -sfn {{.ROOT_DIR}}/fzf {{.XDG_CONFIG_HOME}}/fzf
- "{{.FZF_HOME}}/opt/fzf/install --all --xdg --no-update-rc"
fzf:down:
desc: Removes FZF configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/fzf
################################################################################
# Gems
gem:up:
desc: Configures Rubygems
cmds:
- ln -sfn {{.ROOT_DIR}}/gem {{.XDG_CONFIG_HOME}}/gem
- mkdir -p {{.XDG_DATA_HOME}}/gem
- mkdir -p {{.XDG_CACHE_HOME}}/gem
- gem update --system
- gem update
- gem cleanup
gem:down:
desc: Removes Gems configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/gem
- rm -rf {{.XDG_DATA_HOME}}/gem
- rm -rf {{.XDG_CACHE_HOME}}/gem
################################################################################
# Git
git:up:
desc: Configures Git
cmds:
- ln -sfn {{.ROOT_DIR}}/git {{.XDG_CONFIG_HOME}}/git
git:down:
desc: Removes Git configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/git
################################################################################
# GNU binaries
gnu:up:
desc: Configures GNU binaries
cmds:
- ln -sfn {{.ROOT_DIR}}/gnu {{.XDG_CONFIG_HOME}}/gnu
gnu:down:
desc: Removes GNU binaries configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/gnu
################################################################################
# Golang
go:up:
desc: Configures the Golang development environment
cmds:
- ln -sfn {{.ROOT_DIR}}/golang {{.XDG_CONFIG_HOME}}/golang
- ln -sfn {{.ROOT_DIR}}/golang/golangci.yml {{.HOME}}/.golangci.yml
- ln -sfn {{.ROOT_DIR}}/golang/revive.toml {{.XDG_CONFIG_HOME}}/revive.toml
- go install honnef.co/go/tools/cmd/staticcheck@latest
- go install github.com/sbowman/xq@latest
- go install github.com/oligot/go-mod-upgrade@latest
- go install mvdan.cc/gofumpt@latest
go:down:
desc: Removes Golang configuration
cmds:
- rm -f {{.HOME}}/.golangci.yml
- rm -rf {{.XDG_CONFIG_HOME}}/golang
################################################################################
# Helm
helm:up:
desc: Installs the Helm binary and configuration
cmds:
- ln -sfn {{.ROOT_DIR}}/helm {{.XDG_CONFIG_HOME}}/helm
- cmd: helm plugin install https://github.com/databus23/helm-diff
ignore_error: true
helm:down:
desc: Removes Helm configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/helm
################################################################################
# Homebrew
homebrew:up:
desc: Configures the Homebrew environment
cmds:
- ln -sfn {{.ROOT_DIR}}/homebrew {{.XDG_CONFIG_HOME}}/homebrew
homebrew:down:
desc: Removes Homebrew configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/homebrew
################################################################################
# Intellij
ideavim:up:
desc: Configures IdeaVIM
cmds:
- ln -sfn {{.ROOT_DIR}}/ideavim {{.XDG_CONFIG_HOME}}/ideavim
- defaults write com.jetbrains.intellij ApplePressAndHoldEnabled -bool false
ideavim:down:
desc: Removes IdeaVIM configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/ideavim
- defaults delete com.jetbrains.intellij ApplePressAndHoldEnabled -bool false
################################################################################
# Java
java:up:
desc: Configures the JDK
cmds:
- ln -sfn {{.ROOT_DIR}}/java {{.XDG_CONFIG_HOME}}/java
java:down:
desc: Removes Java configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/java
################################################################################
# K8S
k9s:up:
desc: Configures K9S
cmds:
- ln -sfn {{.ROOT_DIR}}/k9s {{.XDG_CONFIG_HOME}}/k9s
k9s:down:
desc: Removes K9S configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/k9s
################################################################################
# Kubernetes
kube:up:
desc: Configures the Kubernetes environment
cmds:
- ln -sfn {{.ROOT_DIR}}/kubernetes {{.XDG_CONFIG_HOME}}/kubernetes
kube:down:
desc: Removes Kubernetes configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/kubernetes
################################################################################
# Less
less:up:
desc: Configures the Less binary
cmds:
- ln -sfn {{.ROOT_DIR}}/less {{.XDG_CONFIG_HOME}}/less
less:down:
desc: Removes Less configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/less
################################################################################
# MacOS
# macos:up:
# desc: Configures MacOS
# cmds:
# - sudo cp {{.ROOT_DIR}}/macos/limit.maxfiles.plist /Library/LaunchDaemons/limit.maxfiles.plist
# - sudo cp {{.ROOT_DIR}}/macos/limit.maxproc.plist /Library/LaunchDaemons/limit.maxproc.plist
# macos:down:
# desc: Removes MacOS configuration
# cmds:
# - sudo rm -f /Library/LaunchDaemons/limit.maxfiles.plist
# - sudo rm -f /Library/LaunchDaemons/limit.maxproc.plist
################################################################################
# Markdown
markdown:up:
desc: Configures the Markdown linters
cmds:
- ln -sfn {{.ROOT_DIR}}/markdown {{.XDG_CONFIG_HOME}}/markdown
- ln -sf {{.ROOT_DIR}}/markdown/markdownlintrc.json {{.HOME}}/.markdownlintrc
markdown:down:
desc: Removes Markdown configuration
cmds:
- rm -f {{.HOME}}/.markdownlintrc
- npm uninstall -g markdown2confluence
################################################################################
# Node
node:up:
desc: Configures NodeJS
cmds:
- ln -sfn {{.ROOT_DIR}}/node {{.XDG_CONFIG_HOME}}/node
- mkdir -p {{.XDG_DATA_HOME}}/node
node:down:
desc: Removes NodeJS configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/node
- rm -rf {{.XDG_DATA_HOME}}/node
################################################################################
# NPM
npm:up:
desc: Configures NPM
cmds:
- ln -sfn {{.ROOT_DIR}}/npm {{.XDG_CONFIG_HOME}}/npm
- mkdir -p {{.XDG_CACHE_HOME}}/npm
- mkdir -p {{.XDG_DATA_HOME}}/npm
- mkdir -p {{.XDG_RUNTIME_DIR}}/npm
npm:down:
desc: Removes NPM configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/npm
- rm -rf {{.XDG_CACHE_HOME}}/npm
- rm -rf {{.XDG_DATA_HOME}}/npm
- rm -rf {{.XDG_RUNTIME_DIR}}/npm
################################################################################
# Neovim
nvim:up:
desc: Configures Neovim
cmds:
- ln -sfn {{.ROOT_DIR}}/nvim {{.XDG_CONFIG_HOME}}/nvim
- python -m venv {{.XDG_DATA_HOME}}/venvs/neovim
- "{{.XDG_DATA_HOME}}/venvs/neovim/bin/pip3 install -r {{.ROOT_DIR}}/nvim/requirements.txt"
- npm install -g neovim
- gem install neovim
- nvim --headless "+Lazy! sync" +qa
nvim:down:
desc: Removes Neovim configuration
cmds:
- "{{.XDG_DATA_HOME}}/venvs/neovim/bin/pip3 uninstall -y -r {{.ROOT_DIR}}/nvim/requirements.txt"
- rm -rf {{.XDG_DATA_HOME}}/venvs/neovim
- rm -rf {{.XDG_CONFIG_HOME}}/nvim
- npm uninstall -g neovim
- gem uninstall neovim || true
- rm -rf {{.HOME}}/.vimrc_background
- rm -rf {{.XDG_DATA_HOME}}/nvim/lazy
- rm -rf {{.XDG_DATA_HOME}}/nvim/mason
- rm -rf {{.XDG_CONFIG_HOME}}/nvim
################################################################################
# Pip
pip:up:
desc: Configures Pip
cmds:
- ln -sfn {{.ROOT_DIR}}/pip {{.XDG_CONFIG_HOME}}/pip
pip:down:
desc: Removes Pip configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/pip
################################################################################
# PSQL
psql:up:
desc: Configures PSQL
cmds:
- ln -sfn {{.ROOT_DIR}}/psql {{.XDG_CONFIG_HOME}}/psql
- mkdir -p {{.XDG_CACHE_HOME}}/psql
psql:down:
desc: Removes PSQL configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/psql
- rm -rf {{.XDG_CACHE_HOME}}/psql
################################################################################
# Python
python:up:
desc: Configures Python
cmds:
- ln -sfn {{.ROOT_DIR}}/python {{.XDG_CONFIG_HOME}}/python
- ln -sf {{.ROOT_DIR}}/python/flake8.toml {{.XDG_CONFIG_HOME}}/flake8
python:down:
desc: Removes Python configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/python
- rm {{.XDG_CONFIG_HOME}}/flake8
################################################################################
# Readline
readline:up:
desc: Configures Readline
cmds:
- ln -sfn {{.ROOT_DIR}}/readline {{.XDG_CONFIG_HOME}}/readline
readline:down:
desc: Removes Readline configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/readline
################################################################################
ripgrep:up:
desc: Configures Readline
cmds:
- ln -sfn {{.ROOT_DIR}}/ripgrep {{.XDG_CONFIG_HOME}}/ripgrep
ripgrep:down:
desc: Removes Ripgrep configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/ripgrep
################################################################################
# Taskfile
task:up:
desc: Configures Taskfile
cmds:
- ln -sfn {{.ROOT_DIR}}/task {{.XDG_CONFIG_HOME}}/task
task:down:
desc: Removes Taskfile configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/task
################################################################################
# Terraform
terraform:up:
desc: "Links Terraform configuration"
cmds:
- ln -sfn {{.ROOT_DIR}}/terraform {{.XDG_CONFIG_HOME}}/terraform
terraform:down:
desc: "Removes Terraform configuration link"
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/terraform
################################################################################
# TIG
tig:up:
desc: Configures TIG
cmds:
- ln -sfn {{.ROOT_DIR}}/tig {{.XDG_CONFIG_HOME}}/tig
- mkdir -p {{.XDG_DATA_HOME}}/tig
tig:down:
desc: Removes TIG configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/tig
- rm -rf {{.XDG_DATA_HOME}}/tig
################################################################################
# TMUX
tmux:up:
desc: Configures TMUX
cmds:
- ln -sfn {{.ROOT_DIR}}/tmux {{.XDG_CONFIG_HOME}}/tmux
- tic -xe tmux-256color {{.ROOT_DIR}}/tmux/tmux-256color.src
tmux:down:
desc: Removes TMUX configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/tmux
- rm -rf {{.HOME}}/.terminfo
################################################################################
# Vagrant
vagrant:up:
desc: Configures Vagrant
cmds:
- ln -sfn {{.ROOT_DIR}}/vagrant {{.XDG_CONFIG_HOME}}/vagrant
- mkdir -p {{.XDG_DATA_HOME}}/vagrant
- vagrant plugin install vagrant-hosts
vagrant:down:
desc: Removes Vagrant configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/vagrant
- rm -rf {{.XDG_DATA_HOME}}/vagrant
################################################################################
# YAML Lint
yamllint:up:
desc: Configures YAML Lint
cmds:
- ln -sfn {{.ROOT_DIR}}/yamllint {{.XDG_CONFIG_HOME}}/yamllint
yamllint:down:
desc: Removes YAML Lint configuration
cmds:
- rm -rf {{.XDG_CONFIG_HOME}}/yamllint
################################################################################
# ZSH
zsh:up:
desc: Configures ZSH
cmds:
- ln -sfn {{.ROOT_DIR}}/zsh {{.XDG_CONFIG_HOME}}/zsh
- mkdir -p {{.XDG_CACHE_HOME}}/zsh
- mkdir -p {{.XDG_DATA_HOME}}/zsh
- ln -sf {{.ROOT_DIR}}/zsh/zshenv {{.HOME}}/.zshenv
zsh:down:
desc: Removes ZSH configuration
cmds:
- rm -f {{.HOME}}/.zshenv
- rm -rf {{.XDG_CONFIG_HOME}}/zsh
- rm -rf {{.XDG_CACHE_HOME}}/zsh
################################################################################
# ALL
default:
desc: "Deploy all configuration"
cmds:
- task: ensure_xdg
- task: alacritty:up
- task: asdf:up
- task: bash:up
- task: bin:up
- task: direnv:up
- task: docker:up
- task: fd:up
- task: fzf:up
- task: gem:up
- task: git:up
- task: gnu:up
- task: go:up
- task: helm:up
- task: homebrew:up
- task: ideavim:up
- task: java:up
- task: k9s:up
- task: kube:up
- task: less:up
- task: markdown:up
- task: node:up
- task: npm:up
- task: nvim:up
- task: pip:up
- task: psql:up
- task: python:up
- task: readline:up
- task: ripgrep:up
- task: task:up
- task: terraform:up
- task: tig:up
- task: tmux:up
- task: vagrant:up
- task: yamllint:up
- task: zsh:up