-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
619 lines (502 loc) · 20.9 KB
/
Makefile
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
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
export PATH := ${HOME}/.local/bin:${HOME}/.node_modules/bin:${HOME}/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/bin/core_perl:${HOME}/bin:${HOME}/google-cloud-sdk/bin
export GOPATH := ${HOME}
BASE_PKGS := filesystem gcc-libs glibc bash coreutils file findutils gawk grep procps-ng sed tar gettext
BASE_PKGS += pciutils psmisc shadow util-linux bzip2 gzip xz licenses pacman systemd systemd-sysvcompat
BASE_PKGS += iputils iproute2 autoconf sudo automake binutils bison fakeroot flex gcc groff libtool m4
BASE_PKGS += make patch pkgconf texinfo which archlinux-keyring debugedit
PACKAGES := base base-devel go zsh git vim tmux keychain evince unrar hugo ethtool zsh-completions xsel emacs gvfs-smb
PACKAGES += unace iperf valgrind noto-fonts-emoji inkscape file-roller xclip atool debootstrap oath-toolkit
PACKAGES += imagemagick lynx the_silver_searcher cifs-utils elinks flameshot ruby-rdoc ipcalc traceroute
PACKAGES += cups-pdf firefox firefox-i18n-ja gimp strace lhasa hub bookworm tig sysprof pkgfile p7zip
PACKAGES += rsync nodejs debian-archive-keyring gauche cpio aria2 nmap poppler-data ffmpeg asciidoc sbcl
PACKAGES += aspell aspell-en screen mosh diskus gdb wmctrl pwgen linux-docs htop tcpdump gvfs lzop fzf
PACKAGES += gpaste optipng arch-install-scripts pandoc jq pkgstats ruby highlight alsa-utils geckodriver
PACKAGES += texlive-langjapanese tokei texlive-latexextra ctags hdparm eog curl parallel npm yq ansible
PACKAGES += typescript llvm llvm-libs lldb tree w3m whois csvkit pass zsh-syntax-highlighting shellcheck
PACKAGES += bash-completion mathjax expect obs-studio cscope postgresql-libs pdfgrep gnu-netcat cmatrix btop
PACKAGES += jpegoptim nethogs plocate pacman-contrib x11-ssh-askpass libreoffice-fresh-ja tldr streamlink
PACKAGES += jhead peek ncdu gnome-screenshot sshfs fping syncthing terraform bat lshw xdotool sshuttle packer
PACKAGES += ripgrep stunnel vimiv adapta-gtk-theme gnome-tweaks firejail opencv hexedit discord pv perl-net-ip
PACKAGES += smartmontools gnome-logs wireshark-cli wl-clipboard lsof mapnik editorconfig-core-c watchexec
PACKAGES += gtop gopls convmv mpv browserpass-firefox man-db baobab ioping ruby-irb mkcert findomain
PACKAGES += guetzli fabric detox usleep libvterm bind asunder lame git-lfs hex miller bash-language-server
PACKAGES += diffoscope dust rbw eza sslscan abiword pyright miniserve fdupes deno serverless mold fx httpie
PACKAGES += gron typescript-language-server dateutils time xsv rust git-delta zellij jc ruff speedtest-cli
PACKAGES += dconf-editor ghq gopls difftastic csvlens cloc eslint prettier trivy
PIP_PKGS := python-pip python-pipenv python-seaborn python-ipywidgets python-jupyter-client
PIP_PKGS += python-prompt_toolkit python-faker python-matplotlib python-nose python-pandas
PIP_PKGS += python-numpy python-beautifulsoup4
NODE_PKGS := mermaid @mermaid-js/mermaid-cli fx intelephense
NODE_PKGS += dockerfile-language-server-nodejs netlify-cli ngrok
NODE_PKGS += indium logo.svg @marp-team/marp-cli jshint
PACMAN := sudo pacman -S
SYSTEMD_ENABLE := sudo systemctl --now enable
FLUTTER_URL := https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.22.0-stable.tar.xz
.DEFAULT_GOAL := help
.PHONY: all allinstall nextinstall allupdate allbackup
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| sort \
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
all: allinstall nextinstall allupdate allbackup
${HOME}/.local:
mkdir -p $<
rclone: ## Init rclone
$(PACMAN) $@
chmod 600 ${PWD}/.config/rclone/rclone.conf
test -L ${HOME}/.config/rclone || rm -rf ${HOME}/.config/rclone
ln -vsfn ${PWD}/.config/rclone ${HOME}/.config/rclone
gnupg: ## Deploy gnupg (Run after rclone)
$(PACMAN) $@ git-crypt
mkdir -p ${HOME}/.$@
ln -vsf {${PWD},${HOME}}/.$@/gpg-agent.conf
ssh: ## Init ssh
$(PACMAN) open$@
mkdir -p ${HOME}/.$@
chmod 600 ${HOME}/.ssh/id_rsa
init: ## Initial deploy dotfiles
test -L ${HOME}/.emacs.d || rm -rf ${HOME}/.emacs.d
ln -vsfn ${PWD}/.emacs.d ${HOME}/.emacs.d
ln -vsf ${PWD}/.lesskey ${HOME}/.lesskey
lesskey
for item in zshrc vimrc bashrc npmrc myclirc tmux.conf screenrc aspell.conf gitconfig netrc authinfo; do
ln -vsf {${PWD},${HOME}}/.$$item
done
mkdir -p ${HOME}/.config/mpv
ln -vsf {${PWD},${HOME}}/.config/mpv/mpv.conf
ln -vsf {${PWD},${HOME}}/.config/hub
sudo ln -vsf {${PWD},}/etc/hosts
base: ## Install base and base-devel package
$(PACMAN) $(BASE_PKGS)
install: ## Install arch linux packages using pacman
$(PACMAN) $(PACKAGES)
$(PACMAN) pkgfile
sudo pkgfile --update
uv: ## Install uv and setup
$(PACMAN) uv
rye: ## Install rye and setup
$(PACMAN) rye
mkdir ~/.zfunc
rye self completion -s zsh > ~/.zfunc/_rye
pipinstall: ## Install python packages
$(PACMAN) $(PIP_PKGS)
goinstall: ${HOME}/.local ## Install go packages
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/kyoshidajp/ghkw@latest
go install github.com/simeji/jid/cmd/jid@latest
go install github.com/jmhodges/jsonpp@latest
go install github.com/mithrandie/csvq@latest
yarninstall: ## Install yarn global packages
$(PACMAN) yarn
mkdir -p ${HOME}/.node_modules
for pkg in $(NODE_PKGS); do yarn global add $$pkg; done
pnpminstall: ## Install pnpm global packages
$(PACMAN) pnpm
for pkg in $(NODE_PKGS); do pnpm add -g $$pkg; done
rustinstall: ## Install rust and rust language server
$(PACMAN) rustup
rustup default stable
rustup component add rls rust-analysis rust-src
neomutt: ## Init neomutt mail client
$(PACMAN) neomutt
mkdir -p ${HOME}/.mutt
ln -vsf ${PWD}/.muttrc ${HOME}/.muttrc
for item in mailcap certifcates aliases signature; do ln -vsf {${PWD},${HOME}}/.mutt/$$item; done
ln -vsf {${PWD},${HOME}}/.goobookrc
yay -S goobook-git
goobook authenticate
alacritty: ## Init alacritty
$(PACMAN) $@
test -L ${HOME}/.config/$@/[email protected] || rm -rf ${HOME}/.config/$@/[email protected]
mkdir ${HOME}/.config/$@
ln -vsf {${PWD},${HOME}}/.config/$@/[email protected]
urxvt: ## Init rxvt-unicode terminal
$(PACMAN) $@-perls rxvt-unicode
ln -vsf ${PWD}/.Xresources ${HOME}/.Xresources
for item in urxvt{,c,-tabbed}; do sudo ln -vsf {${PWD},}/usr/share/applications/$$item.desktop; done
mkdir -p ${HOME}/.config/autostart
chmod a+x ${PWD}/.auto_start.sh
ln -vsf {${PWD},${HOME}}/.auto_start.sh
ln -vsf ${PWD}/.config/autostart/autostart.desktop ${HOME}/.config/autostart/autostart.desktop
xterm: ## Init xterm terminal
$(PACMAN) $@
ln -vsf {${PWD},${HOME}}/.Xresources
for item in {,u}term; do sudo ln -vsf {${PWD},}/usr/share/applications/$$item.desktop; done
mlterm: ## Init mlterm terminal
yay -S $@
mkdir -p ${HOME}/.$@
for item in main color aafont key; do
ln -vsf {${PWD},${HOME}}/.$@/$$item
done
sudo ln -vsf {${PWD},}/usr/share/applications/[email protected]
sudo ln -vsf {${PWD},}/usr/share/applications/mlclient.desktop
termite: ## Init termite terminal
yay -S $@
mkdir -p ${HOME}/.config/$@
ln -vsf {${PWD},${HOME}}/.config/$@/config
wezterm: ## Init wezterm terminal
$(PACMAN) $@
mkdir -p ${HOME}/.config/$@
ln -vsf {${PWD},${HOME}}/.config/$@/[email protected]
zellij: ## Init zellij
$(PACMAN) $@
mkdir -p ${HOME}/.config/$@
ln -vsf {${PWD},${HOME}}/.config/$@/config.kdl
dnsmasq: ## Init dnsmasq
$(PACMAN) $@
sudo ln -vsf ${PWD}/etc/$@/[email protected] /etc/[email protected]
sudo ln -vsf ${PWD}/etc/$@/[email protected] /etc/[email protected]
sudo mkdir -p /etc/NetworkManager
sudo ln -vsf {${PWD},}/etc/NetworkManager/NetworkManager.conf
tlp: ## Setting for power saving and preventing battery deterioration
$(PACMAN) $@ powertop
sudo ln -vsf {${PWD},}/etc/[email protected]
$(SYSTEMD_ENABLE) [email protected]
lvfs: ## For Linux Vendor Firmware Service
$(PACMAN) fwupd dmidecode
sudo dmidecode -s bios-version
uefiupdate: ## Update system firmware and uefi
for action in refresh get-updates update; do fwupdmgr $$action; done
gtk-theme: ## Set gtk theme
$(PACMAN) gnome-themes-extra arc-gtk-theme xdg-desktop-portal-gnome
gsettings set org.gnome.desktop.interface gtk-theme Adwaita-dark
sudo ln -vsf ${PWD}/.xprofile ${HOME}/.xprofile
test -L ${HOME}/.config/gtk-4.0 || rm -rf ${HOME}/.config/gtk-4.0
ln -vsfn ${PWD}/.config/gtk-4.0 ${HOME}/.config/gtk-4.0
throttled: ## Workaround for Intel throttling issues in thinkpad x1 carbon gen6
$(PACMAN) throttled
$(SYSTEMD_ENABLE) throttled
pipewire-pulse: ## Install pipewire-pulse
$(PACMAN) pipewire-pulse
keyring: ${HOME}/.local ## Init gnome keyrings
$(PACMAN) seahorse
test -L ${HOME}/.local/share/keyrings || rm -rf ${HOME}/.local/share/keyrings
ln -vsfn ${HOME}/{backup,.local/share}/keyrings
ibusmozc: ## Install ibus-mozc
sudo ln -vsf ${PWD}/etc/environment /etc/environment
test -L ${HOME}/.mozc || rm -rf ${HOME}/.mozc
ln -vsfn ${HOME}/backup/mozc ${HOME}/.mozc
mkdir -p ${HOME}/.config/autostart
ln -vsf {${PWD},${HOME}}/.config/autostart/ibus.desktop
yay -S ibus-mozc
ibus-daemon -drx
fcitx-mozc: ## Install fcitx-mozc
$(PACMAN) $@
sudo ln -vsf ${PWD}/etc/environment /etc/environment
mkdir -p ${HOME}/.config/fcitx/addon
ln -vsf {${PWD},${HOME}}/.config/fcitx/addon/fcitx-clipboard.conf
test -L ${HOME}/.mozc || rm -rf ${HOME}/.mozc
ln -vsfn ${HOME}/backup/mozc ${HOME}/.mozc
ttf-cica: ## Install Cica font
yay -S $@
dconfsetting: # Initial dconf setting
$(PACMAN) dconf-editor
dconf write /org/gnome/desktop/input-sources/xkb-options "['ctrl:nocaps']"
dconf write /org/gnome/desktop/interface/gtk-theme "'Adwaita-dark'"
dconf write /org/gnome/desktop/interface/gtk-key-theme "'Emacs'"
dconf write /org/gnome/desktop/interface/text-scaling-factor 1.25
dconf write /org/gnome/desktop/interface/cursor-size 30
dconf write /org/gnome/desktop/interface/clock-show-date true
dconf write /org/gnome/desktop/interface/clock-show-weekday true
dconf write /org/gnome/desktop/interface/show-battery-percentage true
dconf write /org/gnome/desktop/wm/preferences/num-workspaces 1
dconf write /org/gnome/desktop/wm/keybindings/activate-window-menu "['']"
dconf write /org/gnome/desktop/search-providers/disable-external true
dconf write /org/gnome/desktop/privacy/remember-recent-files false
dconf write /org/gnome/shell/keybindings/toggle-overview "['<Alt>space']"
dconf write /org/gnome/mutter/dynamic-workspaces false
localhostssl: # Set ssl for localhost
mkcert -install
mkcert localhost
docker: ## Docker initial setup
$(PACMAN) $@ $@-compose
sudo usermod -aG $@ ${USER}
$(SYSTEMD_ENABLE) [email protected]
podman: ## Podman initial setup
$(PACMAN) $@
$(SYSTEMD_ENABLE) [email protected]
php: ## Init php setting
$(PACMAN) $@ $@-intl
sudo ln -vsf {${PWD},}/etc/php/php.ini
circle-ci-cli: ## Install circle ci cli and setup
curl -fLSs https://circle.ci/cli | sudo bash
circleci update install
maria-db: mariadb
mariadb: ## Mariadb initial setup
sudo ln -vsf {${PWD},}/etc/sysctl.d/40-max-user-watches.conf
$(PACMAN) $@ $@-clients
sudo ln -vsf {${PWD},}/etc/my.cnf
sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
$(SYSTEMD_ENABLE) [email protected]
sudo mysql -u root < ${PWD}/$@/init.sql
mysql_secure_installation
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql
mysql: ## mysql initial setup
yay mysql-clients80
yay mysql80
sudo mysqld --initialize --user=mysql --basedir=/usr --datadir=/var/lib/mysql
$(SYSTEMD_ENABLE) mysqld.service
mysql_secure_installation
tailscale: ## tailscale initial setup
$(PACMAN) $@
$(SYSTEMD_ENABLE) $@d
sudo $@ up
.ONESHELL:
postgresql: ## PostgreSQL initial setup
$(PACMAN) $@
cd /home
sudo -u postgres initdb -E UTF8 --no-locale -D '/var/lib/postgres/data'
$(SYSTEMD_ENABLE) postgresql.service
sudo -u postgres createuser --interactive
remotedesktop: ## Install remotedesktop
$(PACMAN) remmina freerdp libvncserver
eralchemy: ## Install eralchemy
$(PACMAN) graphviz
yay -S $@
mycli: ## Init mycli
mkdir -p ${HOME}/backup/$@
yay -S $@
ln -vsf ${HOME}{/backup/$@,}/.$@-history
pgcli: ## Init pgcli
mkdir -p ${HOME}/backup
yay -S $@
test -L ${HOME}/.config/pgcli || rm -rf ${HOME}/.config/pgcli
ln -vsfn ${HOME}/{backup,.config}/$@
gcloud: ## Install google cloud SDK and setting
$(PACMAN) $@ kubectl kubectx kustomize helm
curl https://sdk.cloud.google.com | bash
test -L ${HOME}/.config/gcloud || rm -rf ${HOME}/.config/gcloud
ln -vsfn ${HOME}/{backup,.config}/gcloud
yay -S stern-bin
minikube: ## Setup minikube with kvm2
$(PACMAN) $@ libvirt qemu-headless ebtables docker-machine
yay -S docker-machine-driver-kvm2
sudo usermod -a -G libvirt ${USER}
$(SYSTEMD_ENABLE) libvirtd.service
$(SYSTEMD_ENABLE) virtlogd.service
$@ config set vm-driver kvm2
kind: ## Setup kind (Kubernetes In Docker)
go install sigs.k8s.io/[email protected]
sudo sh -c "kind completion zsh > /usr/share/zsh/site-functions/_kind"
redis: ## Redis inital setup
$(PACMAN) $@
$(SYSTEMD_ENABLE) [email protected]
dingo: ## Install dingo Google DNS over HTTPS
$(PACMAN) $@
$(SYSTEMD_ENABLE) [email protected]
ccls: ## Install c,c++ language server
$(PACMAN) $@
android: ## Install android-studio
yay -S android-studio
dart: ## Install dart and language server
$(PACMAN) $@
pub global activate $@_language_server
flutter: ## Install flutter
mkdir -p ~/src/github.com/$@
wget -O- $(FLUTTER_URL) | tar -C ~/src/github.com/$@ xf-
spotify: ## Install spotify
gpg --keyserver hkp://keyserver.ubuntu.com --receive-keys 931FF8E79F0876134EDDBDCCA87FF9DF48BF1C90
yay -S spotify
sxiv: ## Init sxiv
$(PACMAN) $@
mkdir -p ${HOME}/.config/$@/exec
ln -vsf {${PWD},${HOME}}/.config/$@/exec/image-info && chmod +x $$_
zeal: ## Deploy zeal config and docsets
yay -S $@
$(PACMAN) qt5-styleplugins qt5ct
sudo ln -vsf ${PWD}/etc/environment /etc/environment
mkdir -p ${HOME}/.config/Zeal
ln -vsf {${PWD},${HOME}}/.config/Zeal/Zeal.conf
emacspeak: ## Install emacspeak for blind person
yay -S $@
intel: ## Setup Intel Graphics
sudo ln -vsf {${PWD},}/etc/X11/xorg.conf.d/20-intel.conf
yay: ## Install yay using yay
yay -S $@
aur: ## Install arch linux AUR packages using yay
yay -S duckdb-bin downgrade git-secrets firebase-tools-bin pscale-cli rgxg slack-desktop trdsql-bin tree-sitter-rust volta-bin zoom
sequeler: ## Install gui database tools
yay -S $@-git
beekeeper: ## Setup beekeeper-studio
yay -S $@-studio-bin
test -L ${HOME}/.config/$@-studio || rm -rf ${HOME}/.config/$@-studio
ln -vsfn ${HOME}/{backup,.config}/$@-studio
dbeaver: ## Setup dbeaver
$(PACMAN) jdk-openjdk
$(PACMAN) dbeaver
sudo archlinux-java set java-21-openjdk
gh: ## Install and setup github-cli
$(PACMAN) github-cli
test -L ${HOME}/.config/gh || rm -rf ${HOME}/.config/gh
ln -vsfn ${HOME}/{backup,.config}/gh
gh extension install seachicken/gh-poi
aurplus: ## Install arch linux AUR packages using yay
yay -S appimagelauncher nkf rtags terraformer-bin
bluetooth: # Setup bluetooth
$(PACMAN) bluez bluez-utils
$(SYSTEMD_ENABLE) bluetooth.service
sudo ln -vsf ${PWD}/etc/bluetooth/main.conf /etc/bluetooth/main.conf
desktop: ## Update desktop entry
for item in vim xterm uxterm urxvt urxvtc urxvt-tabbed; do
sudo ln -vsf {${PWD},}/usr/share/applications/$${item}.desktop
done
toggle: ## Prepare command that toggle between emacs and browser
sudo ln -vsf {${PWD},}/usr/share/applications/[email protected]
sudo install ${PWD}/[email protected] /usr/local/bin/$@
aws: ${HOME}/.local ## Init aws cli
$(PACMAN) aws-cli
ln -vsfn {${PWD},${HOME}}/.$@
awsv2: ## Init aws cli version 2
$(PACMAN) aws-cli-v2
test -L ${HOME}/.aws || rm -rf ${HOME}/.aws
ln -vsfn ${PWD}/.aws ${HOME}/.aws
yay -S awslogs
tmuxp: ${HOME}/.local ## Install tmuxp
$(PACMAN) $@
sudo ln -vsf {${PWD},${HOME}}/.config/main.yaml
roswell: ## Install ros and lem
$(PACMAN) $@
ros install cxxxr/lem
sylpheed: ## Init sylpheed
$(PACMAN) $@
test -L ${HOME}/.sylpheed-2.0 || rm -rf ${HOME}/.sylpheed-2.0
ln -vsfn ${HOME}/{backup/sylpheed,}/.sylpheed-2.0
psd: ## Profile-Sync-Daemon initial setup
yay -S profile-sync-daemon
mkdir -p ${HOME}/.config/psd
ln -vsf ${PWD}/.config/psd/psd.conf ${HOME}/.config/psd/psd.conf
echo "${USER} ALL=(ALL) NOPASSWD: /usr/bin/psd-overlay-helper" | sudo EDITOR='tee -a' visudo
systemctl --user --now enable psd.service
chromium: ## Install chromium and noto-fonts and browserpass
$(PACMAN) $@ browserpass-$@ noto-fonts noto-fonts-cjk
make -C /usr/lib/browserpass hosts-$@-user
test -L ${HOME}/.password-store || rm -rf ${HOME}/.password-store
ln -vsfn ${HOME}/backup/browserpass ${HOME}/.password-store
chrome: ## Install chrome and noto-fonts and browserpass
yay -S google-$@
$(PACMAN) browserpass noto-fonts noto-fonts-cjk
$(MAKE) -C /usr/lib/browserpass hosts-$@-user
test -L ${HOME}/.password-store || rm -rf ${HOME}/.password-store
ln -vsfn ${HOME}/backup/browserpass ${HOME}/.password-store
ollama: ## Init ollama
$(PACMAN) $@
$(SYSTEMD_ENABLE) [email protected]
ollama pull llama3.2
ollama pull lucas2024/gemma-2-2b-jpn-it:q8_0
edge: ## Install edge
yay -S microsoft-edge-stable-bin
neovim: ## Init neovim
$(PACMAN) $@
mkdir -p ${HOME}/.config/nvim
for item in init installer; do \
ln -vsf {${PWD},${HOME}}/.config/nvim/$$item.vim
bash ${HOME}/.config/nvim/installer.sh ${HOME}/.config/nvim
sudo ln -vsf {${PWD},}/usr/share/applications/nvim.desktop
varnish: ## Varnish inital setup
$(PACMAN) $@
sudo ln -vsf {${PWD},}/etc/$@/default.vcl
$(SYSTEMD_ENABLE) [email protected]
mongodb: ## Mongodb initial setup
$(PACMAN) $@ $@-tools
$(SYSTEMD_ENABLE) [email protected]
gnuglobal: ${HOME}/.local ## Install gnu global
$(PACMAN) global python-pygments
.ONESHELL:
SHELL = /bin/bash
elixir-ls: ## Install elixir-ls(Recompile if the version of elixir changes)
$(PACMAN) elixir
git clone [email protected]:JakeBecker/elixir-ls.git ${HOME}/src/github.com/JakeBecker/$@
cd $$_ && mkdir rel
mix deps.get && mix compile
mix elixir_ls.release -o rel
emacs-devel: ## Install development version of emacs
git clone -b emacs-30 [email protected]:emacs-mirror/emacs.git ${HOME}/src/github.com/masasam/emacs
cd ${HOME}/src/github.com/masasam/emacs && ./autogen.sh && ./configure && make && sudo make install && make clean
rm -rf ${HOME}/.emacs.d/elpa
screenkey: ## Init screenkey
$(PACMAN) $@
mkdir -p ${HOME}/.config
ln -vsf ${PWD}/.config/screenkey.json ${HOME}/.config/screenkey.json
rbenv: ## Install rvenv ruby-build
yay -S $@
yay -S ruby-build
$@ install 3.1.4
$@ rehash
gem install bundle
rubygem: ## Install rubygem package
yay -S ruby-solargraph
gem install bundler jekyll sass compass rawler rdoc irb rails
django: ## Create django project from scratch
mkdir -p ${HOME}/src/github.com/masasam && cd $$_ && \
uv python install 3.9 && \
uv python pin 3.9 && \
uv init newproject && \
cd newproject && \
uv sync && \
uv add django && \
uv add python-dotenv && \
source .venv/bin/activate && \
django-admin startproject config .
.ONESHELL:
rails: rubygem rbenv ## Create rails project from scratch
export RBENV_ROOT="${HOME}/.rbenv"
if [ -d "${RBENV_ROOT}" ]; then
export PATH="${RBENV_ROOT}/bin:${PATH}"
eval "$(rbenv init -)"
fi
rbenv rehash
mkdir -p ${HOME}/src/github.com/masasam/$@; cd $$_
rbenv local 3.1.4
bundle init
echo "gem '$@', '~> 7.1.3'" >> Gemfile
bundle install --path vendor/bundle
bundle exec $@ new . --database=mysql --skip-test --skip-turbolinks
bundle exec $@ webpacker:install
dvd: # Backup dvd media
$(PACMAN) libdvdcss dvdbackup
tym: ## Init tym terminal
yay -S $@
mkdir -p ${HOME}/.config/$@
ln -vsf {${PWD},${HOME}}/.config/$@/config.lua
sudo ln -vsf {${PWD},}/usr/share/applications/[email protected]
backup: ## Backup arch linux packages
mkdir -p ${PWD}/archlinux
pacman -Qnq > ${PWD}/archlinux/pacmanlist
pacman -Qqem > ${PWD}/archlinux/aurlist
update: ## Update arch linux packages and save packages cache 3 generations
yay -Syu; paccache -ruk0
pipbackup: ## Backup python global packages
mkdir -p ${PWD}/archlinux
pip freeze > ${PWD}/archlinux/requirements.txt
rustupdate: ## Update rust global packages
cargo install-update -a
yarnupdate: ## Update yarn global packages
yarn global upgrade
pnpmupdate: ## Update pnpm global packages
pnpm self-update
pnpm -g upgrade
mysite: ## My site and blogs source(This is private repository)
ghq get -p masasam/solist
ghq get -p masasam/solistblog
ghq get -p masasam/PPAP
docker_image: docker
docker build -t dotfiles ${PWD}
testbackup: docker_image ## Test this Makefile with mount backup directory
docker run -it --name make$@ -v /home/${USER}/backup:${HOME}/backup:cached --name makefiletest -d dotfiles:latest /bin/bash
for target in install init neomutt aur pipinstall goinstall pnpminstall; do
docker exec -it make$@ sh -c "cd ${PWD}; make $${target}"
done
test: docker_image ## Test this Makefile with docker without backup directory
docker run -it --name make$@ -d dotfiles:latest /bin/bash
for target in install init neomutt aur pipinstall goinstall pnpminstall; do
docker exec -it make$@ sh -c "cd ${PWD}; make $${target}"
done
testpath: ## Echo PATH
PATH=$$PATH
@echo $$PATH
GOPATH=$$GOPATH
@echo $$GOPATH
allinstall: dconfsetting rclone gnupg ssh install init keyring termite alacritty wezterm yay tlp pipewire-pulse ttf-cica dnsmasq goinstall ibusmozc neomutt docker lvfs toggle aur beekeeper kind gtk-theme chrome uv pipinstall
nextinstall: mysql mycli pgcli pnpminstall rubygem rbenv rustinstall postgresql zeal gcloud awsv2 eralchemy gh
allupdate: update rustupdate goinstall pnpmupdate
allbackup: backup pipbackup