-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.asdf
More file actions
333 lines (310 loc) · 11.6 KB
/
Copy pathMakefile.asdf
File metadata and controls
333 lines (310 loc) · 11.6 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
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
SHELL:=/usr/bin/bash
# Yup, you can set different shells
NVIM_PATH=${HOME}/.config/nvim
VIM_PATH=${HOME}/.config/nvim
ENVSUPPORT_PATH=${HOME}/.config/nvim/envsupport
SAMPLE_ENV_VAR_WITH_DEFAULT ?= a-default-value
.ONESHELL:
.SILENT: readme
readme: ensure_cowsay ## Show the project README.md file
@if [ -f ./README.md ] ; then
@cat README.md
@else
@cowsay "Um, you don't have a README.md file"
@while true; do
@read -p "Would you like to make one? [Y/N]: " answer
@case $$answer in
[Yy]* )
@read -p "Enter the title: " the_title
@echo "# $$the_title" >> README.md
@echo "" >> README.md
@read -p "Enter a short description: " the_desc
@echo "$$the_desc" >> README.md
@echo "" >> README.md
@echo "## Usage Section" >> README.md
@echo "... all done!"
break
;;
[Nn]* )
@clear
@cowsay -f ./.brian.cow "WHY DON'T YOU WANT A README????"
@break
;;
* )
@echo "Please answer Y or N."
;;
@esac
@done
@fi
full-monte: ensure_packages ensure_croc ensure_zsh_setup ensure_vimplug install_rc_files install_hack_font ## Install everything
.SILENT: ensure_packages
ensure_packages: install_asdf_tool ## Install the utilities I like to have around
. /etc/os-release
if test "$$ID_LIKE" = 'debian'; then
echo "[====] ... now installing build tools for $$ID_LIKE like system"
echo "[====] ... installing utilities not available via asdf"
sudo apt-get install -y zsh git fortune tmux at sox libsox-fmt-all curl git universal-ctags figlet g++ make scrot gufw imagemagick libncurses5-dev
echo "[====] ... installing build tools for compiling things later on"
echo "[====] ... first for Python"
sudo apt install -y wget build-essential libreadline-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev lzma liblzma-dev
echo "[====] ... some for TMUX"
sudo apt install -y autoconf bison byacc
echo "[====] ... DONE"
elif test "$$ID_LIKE" = 'centos'; then
echo "[====] ... now installing tools for $$ID_LIKE like system "
sudo yum install -y zsh git tmux at curl ctags
elif test "$$ID" = 'nixos'; then
echo "[====] ... now installing tools on $$ID_LIKE "
nix-env -iA nixos.fortune nixos.at nixos.sox nixos.python310Packages.pipx nixos.curl nixos.universal-ctags
fi
echo "Installing various packages to support this config... you will be asked to sudo"
. "${HOME}/.asdf/asdf.sh"
cowsay "Installing neovim"
asdf install neovim stable
cowsay "Installing vim"
asdf install vim latest
cowsay "Installing direnv"
asdf direnv setup --shell zsh --version latest
cowsay "Installing pipx"
asdf install pipx latest
cowsay "Installing exa (ls upgrade)"
asdf install exa latest
cowsay "Installing ripgrep"
asdf install ripgrep latest
cowsay "Installing tmux"
asdf install tmux latest
cowsay "Installing python 3.12.0"
asdf install python 3.12.0
cowsay "Setting python to global"
asdf global python 3.12.0
cowsay "Installing nodejs"
asdf install nodejs latest
cowsay "Installing 1password-cli"
asdf install 1password-cli latest
cowsay "Setting 1password-cli to global"
asdf global 1password-cli latest
cowsay "Installing bottom - process monitor"
asdf install bottom latest
cowsay "Installing bat - cat on steroids"
asdf install bat latest
cowsay "Installing awscli"
asdf install awscli latest
cowsay "Installing deno - modern JS runtime"
asdf install deno latest
cowsay "Installing dasel - jq for lot's of file types"
asdf install dasel latest
cowsay "Installing difftastic - Syntax and nesting aware diff tool"
asdf install difftastic latest
cowsay "Installing duf - disk usage tool, upgraded du"
asdf install duff latest
cowsay "Installing erlang"
KERL_CONFIGURE_OPTIONS="--disable-debug --without-javac"
asdf install erlang latest
cowsay "Installing gleam lang - runs on erlang or js"
asdf install gleam latest
cowsay "Installing gum - tools and prompts for shell scripts"
asdf install gum latest
cowsay "Installing has - info about installed apps and versions"
asdf install has latest
cowsay "Installing httpie-go - simple http client: ht"
asdf install httpie-go latest
cowsay "Installing jq - jq formatter and filter tool"
asdf install jq latest
cowsay "Installing pdm - python package manager"
asdf install pdm latest
cowsay "Installing restic - backup tool"
asdf install restic latest
cowsay "Installing regclient - docker registry client"
asdf install regsync latest
asdf install regctl latest
cowsay "Installing rclone - cloud file system tool"
asdf install rclone latest
cowsay "Installing SQLite"
asdf install sqlite latest
cowsay "Installing Viddy - watch command on steroids"
asdf install viddy latest
.SILENT: ensure_zsh_setup
ensure_zsh_setup: install_asdf_tool ## Install oh-my-zsh and zgen
# Fetch oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Fetch zgen for zsh package management
git clone https://github.com/tarjoilija/zgen.git ${HOME}/.zgen
.SILENT: ensure_flatpak
ensure_flatpak: ## Install flatpak package manager
. /etc/os-release
if test "$$ID_LIKE" = 'debian'; then
echo "[====] ... now installing flatpak for $$ID_LIKE like system"
sudo apt-get install -y flatpak
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
echo "[====] ... recommend reboot for XDG_DATA_DIRS path"
elif test "$$ID" = 'rocky'; then
echo "[====] ... now installing flatpak for $$ID linux"
sudo dnf install flatpak
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
echo "[====] ... recommend reboot for XDG_DATA_DIRS path"
elif test "$$ID_LIKE" = 'centos'; then
echo "[====] ... already on system"
fi
.SILENT: ensure_vim_plug
ensure_vimplug: ## Install vim-plug
curl -fLo $(VIM_PATH)/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
.SILENT: ensure_croc
ensure_croc: ## Get the croc file transfer utility
figlet "Get croc"
curl https://getcroc.schollz.com | bash
.SILENT: install_flatpak_apps
install_flatpak_apps: ## Various desktop apps I like to have from flatpaks
figlet "flatpak: digiKam"
flatpak install -y org.kde.digikam
figlet "flatpak: Telegram"
flatpak install -y org.telegram.desktop
figlet "flatpak: XMPP clients"
flatpak install -y im.kaidan.kaidan org.gajim.Gajim im.dino.Dino
figlet "flatpak: Mind Mapping"
flatpak install -y net.xmind.XMind com.github.phase1geo.minder
figlet "flatpak: GIMP"
flatpak install -y org.gimp.GIMP
figlet "flatpak: Reco audio recorder"
flatpak install -y com.github.ryonakano.reco
figlet "flatpak: Scans to PDF"
flatpak install -y com.github.unrud.djpdf
figlet "flatpak: Handbrake"
flatpak install -y fr.handbrake.ghb
figlet "flatpak: Okular"
flatpak install -y org.kde.okular
.SILENT: install_greenclip_clipboard
install_greenclip_clipboard: ## Install the greenclip clipboard manager
mkdir -p ~/.local/bin && cd ~/.local/bin
wget https://github.com/erebe/greenclip/releases/download/v4.2/greenclip
chmod +x greenclip
cd ~/.config
cp ./nvim/envsupport/regolith/greenclip.toml .
.SILENT: install_rc_files
install_rc_files: ## Set up support files and links
# Install supporting RC files
if [[ -n $(ENVSUPPORT_PATH) ]]; then
echo "Installing symlinks from '$(HOME)' to '$(ENVSUPPORT_PATH)'"
cd $(HOME)
ln -fs $(ENVSUPPORT_PATH)/zsh/dot.zshrc .zshrc
ln -fs $(ENVSUPPORT_PATH)/tmux/dot.tmux.conf .tmux.conf
# USED for non-public keys #ln -fs $SUPPORT_PATH/zshenv .zshenv
ln -fs $(ENVSUPPORT_PATH)/git/dot.gitconfig .gitconfig
ln -fs $(ENVSUPPORT_PATH)/git/dot.gitignore_shared .gitignore_shared
ln -fs $(ENVSUPPORT_PATH)/dot.npmrc .npmrc
ln -fs $(ENVSUPPORT_PATH)/../init.vim .vimrc
mkdir -p ~/.vim
ln -fs $(VIM_PATH)/bundle ~/.vim/plugged
ln -fs $(VIM_PATH)/plugin ~/.vim/plugin
ln -fs $(VIM_PATH)/autoload ~/.vim/autoload
echo '# add local shell changes here' >> ~/.zsh.local
echo '" Add local vim settings here ' >> ~/.nvimlocal.vim
fi
.SILENT: install_asdf_tool
install_asdf_tool: ensure_cowsay ## Install the asdf tool versions manager
. /etc/os-release
if ! command -v asdf &> /dev/null
then
figlet "git: asdf"
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.13.1
. "${HOME}/.asdf/asdf.sh"
cowsay "Adding asdf plugins"
asdf plugin add neovim
asdf plugin add vim
asdf plugin add pipx
asdf plugin add exa
asdf plugin add ripgrep
asdf plugin add direnv
asdf plugin add tmux
asdf plugin add python
asdf plugin add nodejs
asdf plugin add 1password-cli
asdf plugin add bun
asdf plugin add bottom
asdf plugin add bat
asdf plugin add awscli
asdf plugin add deno
asdf plugin add dasel
asdf plugin add difftastic
asdf plugin add duf
asdf plugin add erlang
asdf plugin add gleam
asdf plugin add gum
asdf plugin add has https://github.com/sylvainmetayer/asdf-has
asdf plugin add httpie-go https://github.com/abatilo/asdf-httpie-go.git
asdf plugin add jq
asdf plugin-add poetry https://github.com/asdf-community/asdf-poetry.git
asdf plugin add pdm
asdf plugin add restic
asdf plugin add regsync
asdf plugin add regctl
asdf plugin add rclone
asdf plugin add sqlite
asdf plugin add viddy
fi
echo "Done ensuring asdf"
.SILENT: install_hack_font
install_hack_font: ## Install the Nerd Hack font
mkdir -p $(HOME)/.local/share/fonts $(HOME)/.config/fontconfig/conf.d
cp $(ENVSUPPORT_PATH)/fonts/ttf/* $(HOME)/.local/share/fonts/
cp $(ENVSUPPORT_PATH)/fonts/45-hack.conf $(HOME)/.config/fontconfig/conf.d
fc-cache -f -v
fc-list | grep "Hack"
.SILENT: install_nerd_fonts
install_nerd_fonts: ## Install the Nerd Fonts repo
echo "Downloading repo"
cd /tmp
git clone --depth 1 https://github.com/ryanoasis/nerd-fonts.git
cd nerd-fonts
chmod +x ./install.sh
./install.sh
.SILENT: install_entr
install_entr: ## entr - File watcher and command runner
figlet "Building entr"
mkdir -p /tmp/entr_src
cd /tmp/entr_src
git clone https://github.com/eradman/entr.git
cd entr
./configure
make test
sudo make install
archive-repo: ## Make a tar/gzip archive of the repo with the date
mydir=`pwd`
@cd ..
@tar cvzf nvim-setup-`date +%Y-%m-%dT%H%M`.tgz $$mydir
.SILENT: ensure_cowsay
ensure_cowsay: # install the cowsay tool (single hash keeps me out of the menu)
. /etc/os-release
if ! command -v cowsay &> /dev/null
then
echo "[====] ... now installing cowsay $$ID_LIKE "
if test "$$ID_LIKE" = 'debian'; then
echo "[====] debian like system - requesting SUDO password"
sudo apt-get install -y fortune cowsay
elif test "$$ID_LIKE" = 'centos'; then
echo "[====] centos like system - requesting SUDO password"
sudo yum install -y fortune cowsay
elif test "$$ID" = 'nixos'; then
echo "[====] nixos"
nix-env -iA nixos.cowsay
fi
fi
.SILENT: extra_cows
extra_cows: ## Install additional cows for cowsay
ejq latestcho "[====] ... now installing extra cowsay cows, with sudo "
git clone https://github.com/paulkaefer/cowsay-files.git ~/.cows
cd ~/.cows
sudo make install
echo "[====] ... updating COWPATH env var in ~/.zsh.local"
echo "export COWPATH=/usr/local/share/cowsay-files/cows:/usr/share/cowsay/cows" > ~/.zsh.local
.PHONY: help
.SILENT: help
help: ensure_cowsay
if [ -f ./README.md ] ; then
grep "^\#" -m 2 -n README.md | awk 'NR>1 {split($$0,a,":"); print a[1] | "read c; c=$$((c-1)); head -n $$c README.md" }'
echo "========================================================================"
else
cowsay "Add a README.md for a better description"
fi
grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.DEFAULT_GOAL := help
# :vim set ts=4 sw=4 :