Move software.sh back into separate installer scripts and add to
Makefile
This commit is contained in:
parent
c1d33bd9cf
commit
b55cd653e7
23
Makefile
23
Makefile
|
@ -15,34 +15,31 @@ BIN_ITEMS := $(wildcard bin/*)
|
||||||
BIN_TARGETS := $(BIN_ITEMS:bin/%=$(LOCAL_BIN)/%)
|
BIN_TARGETS := $(BIN_ITEMS:bin/%=$(LOCAL_BIN)/%)
|
||||||
ZSH_ITEMS := $(wildcard *.zsh)
|
ZSH_ITEMS := $(wildcard *.zsh)
|
||||||
ZSH_TARGETS := $(ZSH_ITEMS:%.zsh=$(ZSH_CUSTOM_DIR)/%.zsh)
|
ZSH_TARGETS := $(ZSH_ITEMS:%.zsh=$(ZSH_CUSTOM_DIR)/%.zsh)
|
||||||
|
INSTALLER_ITEMS := $(wildcard installers/*)
|
||||||
|
INSTALLER_TARGETS := $(INSTALLER_ITEMS:installers/%.sh=%)
|
||||||
|
|
||||||
PACKER_REPO := https://github.com/wbthomason/packer.nvim
|
PACKER_REPO := https://github.com/wbthomason/packer.nvim
|
||||||
PACKER_DIR := $(HOME)/.local/share/nvim/site/pack/packer/start/packer.nvim
|
PACKER_DIR := $(HOME)/.local/share/nvim/site/pack/packer/start/packer.nvim
|
||||||
POWERLEVEL_REPO := https://github.com/romkatv/powerlevel10k.git
|
POWERLEVEL_REPO := https://github.com/romkatv/powerlevel10k.git
|
||||||
POWERLEVEL_DIR := $(ZSH_CUSTOM_DIR)/themes/powerlevel10k
|
POWERLEVEL_DIR := $(ZSH_CUSTOM_DIR)/themes/powerlevel10k
|
||||||
|
|
||||||
.PHONY := all force clean config zsh nvim ssh git
|
.PHONY := all force clean config zsh nvim ssh git bin $(INSTALLER_TARGETS)
|
||||||
|
|
||||||
all: config zsh nvim ssh git
|
config: $(CONFIG_TARGETS) $(SYSTEMD_TARGETS) zsh ssh
|
||||||
|
|
||||||
|
bin: $(BIN_TARGETS) $(INSTALLER_TARGETS)
|
||||||
|
|
||||||
|
all: config bin
|
||||||
|
|
||||||
force: clean all
|
force: clean all
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
curl -sSL https://install.python-poetry.org | python3 - --uninstall
|
curl -sSL https://install.python-poetry.org | python3 - --uninstall
|
||||||
|
|
||||||
config: $(CONFIG_TARGETS) $(SYSTEMD_TARGETS)
|
|
||||||
|
|
||||||
zsh: $(ZSH_DIR) $(ZSH_CUSTOM_DIR) $(POWERLEVEL_DIR) $(ZSH_TARGETS)
|
zsh: $(ZSH_DIR) $(ZSH_CUSTOM_DIR) $(POWERLEVEL_DIR) $(ZSH_TARGETS)
|
||||||
|
|
||||||
nvim: $(PACKER_DIR)
|
|
||||||
|
|
||||||
ssh: $(HOME)/.ssh/config
|
ssh: $(HOME)/.ssh/config
|
||||||
|
|
||||||
git: $(HOME)/.gitconfig
|
|
||||||
grep "name" $? > /dev/null || git config --global user.name "Evie Litherland-Smith"
|
|
||||||
grep "editor" $? > /dev/null || git config --global core.editor "nvim"
|
|
||||||
grep "rebase" $? > /dev/null || git config --global pull.rebase false
|
|
||||||
|
|
||||||
$(CONFIG_TARGETS): $(CONFIG_DIR)/%: config/%
|
$(CONFIG_TARGETS): $(CONFIG_DIR)/%: config/%
|
||||||
$(SYSTEMD_TARGETS): $(SYSTEMD_DIR)/%: systemd/%
|
$(SYSTEMD_TARGETS): $(SYSTEMD_DIR)/%: systemd/%
|
||||||
$(FONT_TARGETS): $(FONT_DIR)/%: nerdfont_symbols/%
|
$(FONT_TARGETS): $(FONT_DIR)/%: nerdfont_symbols/%
|
||||||
|
@ -53,8 +50,8 @@ $(CONFIG_TARGETS) $(SYSTEMD_TARGETS) $(FONT_TARGETS) $(ZSH_TARGETS):
|
||||||
$(BIN_TARGETS): $(LOCAL_BIN)/%: bin/%
|
$(BIN_TARGETS): $(LOCAL_BIN)/%: bin/%
|
||||||
command -v $? 2> /dev/null || ln -s $(PWD)$? $@
|
command -v $? 2> /dev/null || ln -s $(PWD)$? $@
|
||||||
|
|
||||||
$(LOCAL_BIN)/poetry: $(LOCAL_BIN)
|
$(INSTALLER_TARGETS): $(LOCAL_BIN)
|
||||||
command -v poetry > /dev/null || curl -sSL https://install.python-poetry.org | python3 -
|
./installers/$@.sh
|
||||||
|
|
||||||
$(HOME)/.ssh/config: $(HOME)/.ssh $(HOME)/.ssh/sockets
|
$(HOME)/.ssh/config: $(HOME)/.ssh $(HOME)/.ssh/sockets
|
||||||
cp -n templates/ssh-config $@
|
cp -n templates/ssh-config $@
|
||||||
|
|
5
installers/fzf.sh
Executable file
5
installers/fzf.sh
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
command -v fzf > /dev/null && exit 0
|
||||||
|
git clone --depth 1 https://github.com/junegunn/fzf.git "$HOME/.fzf"
|
||||||
|
"$HOME/.fzf/install"
|
15
installers/kitty.sh
Executable file
15
installers/kitty.sh
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# kitty
|
||||||
|
command -v kitty > /dev/null && exit 0
|
||||||
|
curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin
|
||||||
|
# Create a symbolic link to add kitty to PATH (assuming $HOME/.local/bin is in
|
||||||
|
# your system-wide PATH)
|
||||||
|
ln -s "$HOME/.local/kitty.app/bin/kitty" "$HOME/.local/bin/"
|
||||||
|
# Place the kitty.desktop file somewhere it can be found by the OS
|
||||||
|
cp "$HOME/.local/kitty.app/share/applications/kitty.desktop" "$HOME/.local/share/applications/"
|
||||||
|
# If you want to open text files and images in kitty via your file manager also add the kitty-open.desktop file
|
||||||
|
cp "$HOME/.local/kitty.app/share/applications/kitty-open.desktop" "$HOME/.local/share/applications/"
|
||||||
|
# Update the paths to the kitty and its icon in the kitty.desktop file(s)
|
||||||
|
sed -i "s|Icon=kitty|Icon=/home/$USER/.local/kitty.app/share/icons/hicolor/256x256/apps/kitty.png|g" "$HOME/.local/share/applications/kitty.desktop"
|
||||||
|
sed -i "s|Exec=kitty|Exec=/home/$USER/.local/kitty.app/bin/kitty|g" "$HOME/.local/share/applications/kitty.desktop"
|
7
installers/neovim.sh
Executable file
7
installers/neovim.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
command -v nvim > /dev/null && exit 0
|
||||||
|
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
|
||||||
|
chmod u+x nvim.appimage
|
||||||
|
mv nvim.appimage "$HOME/.local/bin/nvim"
|
||||||
|
ln -s "$HOME/.local/bin/nvim" "$HOME/.local/bin/vim"
|
7
installers/pipx.sh
Executable file
7
installers/pipx.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
command -v pipx > /dev/null || python3 -m pip install --user pipx
|
||||||
|
command -v poetry > /dev/null || python3 -m pipx install poetry
|
||||||
|
pipx list | grep -i python-lsp-server && exit 0
|
||||||
|
python3 -m pipx install python-lsp-server && python3 -m pipx inject python-lsp-server pylsp-mypy python-lsp-black python-lsp-isort
|
||||||
|
|
11
installers/pyenv.sh
Executable file
11
installers/pyenv.sh
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
command -v pyenv > /dev/null && exit 0
|
||||||
|
curl https://pyenv.run | bash
|
||||||
|
# Below are suggested dependencies for python
|
||||||
|
# command -v apt > /dev/null && {
|
||||||
|
# sudo apt update
|
||||||
|
# sudo apt install build-essential libssl-dev zlib1g-dev \
|
||||||
|
# libbz2-dev libreadline-dev libsqlite3-dev curl llvm \
|
||||||
|
# libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
|
||||||
|
# }
|
|
@ -2,9 +2,6 @@ kitty
|
||||||
neovim
|
neovim
|
||||||
fzf
|
fzf
|
||||||
pyenv
|
pyenv
|
||||||
pyright
|
|
||||||
pipx
|
pipx
|
||||||
black
|
|
||||||
isort
|
|
||||||
pre-commit
|
pre-commit
|
||||||
ranger
|
ranger
|
||||||
|
|
62
software.sh
62
software.sh
|
@ -1,62 +0,0 @@
|
||||||
#! /usr/bin/env bash
|
|
||||||
# Install various programs
|
|
||||||
|
|
||||||
echo "Not for use"
|
|
||||||
exit 1
|
|
||||||
|
|
||||||
mkdir -p "$HOME/.local/bin"
|
|
||||||
|
|
||||||
# python
|
|
||||||
command -v apt > /dev/null && sudo apt install python3 python3-pip python3-venv
|
|
||||||
|
|
||||||
# pyenv
|
|
||||||
command -v pyenv > /dev/null || {
|
|
||||||
curl https://pyenv.run | bash
|
|
||||||
# Below are suggested dependencies for python
|
|
||||||
command -v apt > /dev/null && {
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install build-essential libssl-dev zlib1g-dev \
|
|
||||||
libbz2-dev libreadline-dev libsqlite3-dev curl llvm \
|
|
||||||
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# pipx
|
|
||||||
command -v pipx > /dev/null || python3 -m pip install --user pipx
|
|
||||||
command -v pyright > /dev/null || python3 -m pipx install pyright
|
|
||||||
command -v poetry > /dev/null || python3 -m pipx install poetry
|
|
||||||
command -v black > /dev/null || python3 -m pipx install black
|
|
||||||
command -v isort > /dev/null || python3 -m pipx install isort
|
|
||||||
command -v zimports > /dev/null || python3 -m pipx install zimports
|
|
||||||
command -v pre-commit > /dev/null || python3 -m pipx install pre-commit
|
|
||||||
command -v ranger > /dev/null || python3 -m pipx install ranger-fm
|
|
||||||
command -v euporie > /dev/null || python3 -m pipx install euporie
|
|
||||||
|
|
||||||
# kitty
|
|
||||||
command -v kitty > /dev/null || {
|
|
||||||
curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin
|
|
||||||
# Create a symbolic link to add kitty to PATH (assuming $HOME/.local/bin is in
|
|
||||||
# your system-wide PATH)
|
|
||||||
ln -s "$HOME/.local/kitty.app/bin/kitty" "$HOME/.local/bin/"
|
|
||||||
# Place the kitty.desktop file somewhere it can be found by the OS
|
|
||||||
cp "$HOME/.local/kitty.app/share/applications/kitty.desktop" "$HOME/.local/share/applications/"
|
|
||||||
# If you want to open text files and images in kitty via your file manager also add the kitty-open.desktop file
|
|
||||||
cp "$HOME/.local/kitty.app/share/applications/kitty-open.desktop" "$HOME/.local/share/applications/"
|
|
||||||
# Update the paths to the kitty and its icon in the kitty.desktop file(s)
|
|
||||||
sed -i "s|Icon=kitty|Icon=/home/$USER/.local/kitty.app/share/icons/hicolor/256x256/apps/kitty.png|g" "$HOME/.local/share/applications/kitty.desktop"
|
|
||||||
sed -i "s|Exec=kitty|Exec=/home/$USER/.local/kitty.app/bin/kitty|g" "$HOME/.local/share/applications/kitty.desktop"
|
|
||||||
}
|
|
||||||
|
|
||||||
# neovim
|
|
||||||
command -v nvim > /dev/null || {
|
|
||||||
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
|
|
||||||
chmod u+x nvim.appimage
|
|
||||||
mv nvim.appimage "$HOME/.local/bin/nvim"
|
|
||||||
ln -s "$HOME/.local/bin/nvim" "$HOME/.local/bin/vim"
|
|
||||||
}
|
|
||||||
|
|
||||||
# fzf
|
|
||||||
command -v fzf > /dev/null || {
|
|
||||||
git clone --depth 1 https://github.com/junegunn/fzf.git "$HOME/.fzf"
|
|
||||||
"$HOME/.fzf/install"
|
|
||||||
}
|
|
Loading…
Reference in a new issue