dot-files/Makefile

212 lines
3.9 KiB
Makefile
Raw Normal View History

CLI_PACKAGES := \
bash \
flake8 \
2019-12-04 11:55:10 +01:00
gdb \
git \
haskell \
isort \
2019-12-08 22:21:13 +01:00
mypy \
2020-04-07 17:56:51 +02:00
remind \
scripts \
shell \
2020-05-01 16:47:38 +02:00
ssh \
tin \
tmux \
vim \
zsh \
VISUAL_PACKAGES := \
X \
desktop \
dunst \
fontconfig \
i3 \
i3blocks \
redshift \
rofi \
2020-06-24 11:33:05 +02:00
system-X \
termite \
tridactyl \
wallpapers \
2019-11-05 11:43:12 +01:00
zathura \
CLI_DEPENDENCIES := \
aur/bitwarden-cli \
aur/cppreference \
aur/git-absorb \
aur/stdman \
aur/zsh-fast-syntax-highlighting-git \
community/bat \
community/fd \
community/fzf \
community/git-lfs \
2020-07-14 21:35:24 +02:00
community/global \
community/lesspipe \
community/mosh \
2019-12-08 22:21:13 +01:00
community/mypy \
community/pandoc \
community/ripgrep \
2020-08-22 18:32:40 +02:00
community/rustup \
community/shellcheck \
community/shfmt \
community/stack \
community/stow \
community/tig \
community/tmux \
community/udiskie \
community/zsh-completions \
core/archlinux-keyring \
core/openssh \
extra/bash-completion \
extra/ctags \
extra/git \
extra/imagemagick \
extra/keychain \
extra/networkmanager \
2020-08-22 21:19:26 +02:00
extra/vim \
extra/vim-runtime \
extra/zsh \
VISUAL_DEPENDENCIES := \
aur/bitwarden-rofi \
aur/gnome-ssh-askpass3 \
aur/i3-battery-popup-git \
aur/i3blocks-contrib-git \
aur/networkmanager-dmenu-git \
2020-05-25 18:43:25 +02:00
aur/qsyncthingtray \
aur/rofi-dmenu \
2020-05-29 17:35:48 +02:00
aur/rofi-emoji \
aur/spotify \
community/acpi \
community/dunst \
2020-06-16 11:27:04 +02:00
community/flameshot \
community/i3lock-color \
community/playerctl \
community/redshift \
2020-05-25 18:43:25 +02:00
community/syncthing \
community/sysstat \
community/termite \
community/xautolock \
community/xsel \
community/zathura \
community/zathura-cb \
community/zathura-djvu \
community/zathura-pdf-poppler \
community/zathura-ps \
extra/firefox \
extra/nm-connection-editor \
extra/noto-fonts-emoji \
extra/thunderbird \
extra/vlc \
HASKELL_DEPENDENCIES := \
brittany \
hlint \
STOW_TARGET := $(HOME)
STOW = stow -t $(STOW_TARGET) -R -v
YAY := yay -S --noconfirm
.PHONY: all
all: install
# Install packages and their dependencies
.PHONY: install-cli
install-cli: install-cli-deps
install-cli: link-cli
install-cli: rust haskell
.PHONY: install
install: install-cli
install: install-visual-deps
install: link-visual
.PHONY: install-cli-deps
install-cli-deps:
$(YAY) $(CLI_DEPENDENCIES)
.PHONY: install-visual-deps
install-visual-deps:
$(YAY) $(VISUAL_DEPENDENCIES)
# Linking packages
2019-12-17 18:22:43 +01:00
.PHONY: link-all
link-all: link-cli link-visual
.PHONY: link-cli
link-cli: $(addprefix stow-,$(CLI_PACKAGES))
.PHONY: link-visual
link-visual: $(addprefix stow-,$(VISUAL_PACKAGES))
# Installing configuration packages
.PHONY: $(addprefix stow-,$(CLI_PACKAGES))
.PHONY: $(addprefix stow-,$(VISUAL_PACKAGES))
stow-%: %
$(STOW) $<
stow-scripts: STOW_TARGET=~/.scripts
stow-scripts: scripts
mkdir -p $(STOW_TARGET)
$(STOW) $<
2020-06-24 11:33:05 +02:00
stow-system-X: STOW_TARGET=/
stow-system-X: system-X
sudo $(STOW) $<
stow-tin: tin
rm -rf $(STOW_TARGET)/.tin
ln -s $(realpath tin/.tin) $(STOW_TARGET)/.tin
stow-tmux: tmux
$(STOW) $<
[ -d ~/.config/tmux/plugins/tpm ] || \
git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm;
~/.config/tmux/plugins/tpm/bin/install_plugins
stow-vim: vim
$(STOW) $<
vim +PlugInstall +qa
# Removing packages
.PHONY: unlink-all
unlink-all: unlink-cli unlink-visual
.PHONY: unlink-cli
unlink-cli: $(addprefix unstow-,$(CLI_PACKAGES))
.PHONY: unlink-visual
unlink-visual: $(addprefix unstow-,$(VISUAL_PACKAGES))
.PHONY: $(addprefix unstow-,$(CLI_PACKAGES))
.PHONY: $(addprefix unstow-,$(VISUAL_PACKAGES))
unstow-%:
$(STOW) -D $*
unstow-scripts: STOW_TARGET=~/.scripts
unstow-scripts:
$(STOW) -D scripts
2020-06-24 11:33:05 +02:00
unstow-system-X: STOW_TARGET=/
unstow-system-X:
sudo $(STOW) -D system-X
unstow-tin:
rm -f $(STOW_TARGET)/.tin
unstow-tmux:
$(STOW) -D tmux
rm -rf ~/.config/tmux/plugins/
2020-08-22 18:32:40 +02:00
# The `rustup` package does not install a toolchain by default
.PHONY: rust
rust:
2020-08-22 18:32:40 +02:00
rustup default stable
.PHONY: haskell
haskell:
if [ -n "$(HASKELL_DEPENDENCIES)" ]; then \
stack build --copy-compiler-tool $(HASKELL_DEPENDENCIES); \
fi