diff --git a/.config/yadm/bootstrap b/.config/yadm/bootstrap new file mode 100755 index 0000000..1b8e473 --- /dev/null +++ b/.config/yadm/bootstrap @@ -0,0 +1,30 @@ +#!/bin/bash + +# Save this file as ~/.config/yadm/bootstrap and make it executable. It will +# execute all executable files (excluding templates and editor backups) in the +# ~/.config/yadm/bootstrap.d directory when run. + +set -eu + +# Directory to look for bootstrap executables in +BOOTSTRAP_D="${BASH_SOURCE[0]}.d" + +if [[ ! -d "$BOOTSTRAP_D" ]]; then + echo "Error: bootstrap directory '$BOOTSTRAP_D' not found" >&2 + exit 1 +fi + +declare -a bootstraps +while IFS= read -r bootstrap; do + if [[ -x "$bootstrap" && ! "$bootstrap" =~ "##" && ! "$bootstrap" =~ ~$ ]]; then + bootstraps+=("$bootstrap") + fi +done < <(find -L "$BOOTSTRAP_D" -type f | sort) + +for bootstrap in "${bootstraps[@]}"; do + if ! "$bootstrap"; then + echo "Error: bootstrap '$bootstrap' failed" >&2 + exit 1 + fi +done + diff --git a/.config/yadm/bootstrap.d/01-paru b/.config/yadm/bootstrap.d/01-paru new file mode 100755 index 0000000..c0c5010 --- /dev/null +++ b/.config/yadm/bootstrap.d/01-paru @@ -0,0 +1,11 @@ +#!/bin/bash +if pacman -Q paru; then + exit 0 +fi + +sudo pacman -S --needed base-devel +git clone https://aur.archlinux.org/paru.git /tmp/paru +cd /tmp/paru +makepkg -si +cd +rm -rf /tmp/paru diff --git a/.config/yadm/bootstrap.d/02-packages b/.config/yadm/bootstrap.d/02-packages new file mode 100755 index 0000000..b4278ce --- /dev/null +++ b/.config/yadm/bootstrap.d/02-packages @@ -0,0 +1,8 @@ +#!/bin/bash +while read -r line; do + if paru -Q $line; then + echo "$line installed" + else + paru -S --noconfirm $line + fi +done <$HOME/.config/yadm/files/packages.txt diff --git a/.config/yadm/bootstrap.d/03-shell b/.config/yadm/bootstrap.d/03-shell new file mode 100755 index 0000000..268ae70 --- /dev/null +++ b/.config/yadm/bootstrap.d/03-shell @@ -0,0 +1,8 @@ +#!/bin/bash +if [ $SHELL = '/bin/zsh' ]; then + exit 0 +else + chsh --shell /bin/zsh + + git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k +fi diff --git a/.config/yadm/bootstrap.d/04-docker b/.config/yadm/bootstrap.d/04-docker new file mode 100755 index 0000000..9845950 --- /dev/null +++ b/.config/yadm/bootstrap.d/04-docker @@ -0,0 +1,9 @@ +#!/bin/bash +if pacman -Q docker; then + exit 0 +else + sudo pacman -S --noconfirm docker + + sudo usermod -aG docker vylpes + sudo systemctl enable --now docker +fi diff --git a/.config/yadm/bootstrap.d/05-gnome-keyring b/.config/yadm/bootstrap.d/05-gnome-keyring new file mode 100755 index 0000000..de3c062 --- /dev/null +++ b/.config/yadm/bootstrap.d/05-gnome-keyring @@ -0,0 +1,6 @@ +#!/bin/bash +if [ $(cat /etc/pam.d/login | grep pam_gnome_keyring.so | wc -l) = "0" ]; then + sudo cp $HOME/.config/yadm/files/login /etc/pam.d/login +else + exit 0 +fi diff --git a/.config/yadm/bootstrap.d/06-files b/.config/yadm/bootstrap.d/06-files new file mode 100755 index 0000000..6862e3e --- /dev/null +++ b/.config/yadm/bootstrap.d/06-files @@ -0,0 +1,5 @@ +#!/bin/bash +mkdir -p $HOME/Documents +mkdir -p $HOME/Downloads +mkdir -p $HOME/Desktop +mkdir -p $HOME/Pictures/captures diff --git a/.config/yadm/bootstrap.d/07-qemu b/.config/yadm/bootstrap.d/07-qemu new file mode 100755 index 0000000..48624f7 --- /dev/null +++ b/.config/yadm/bootstrap.d/07-qemu @@ -0,0 +1,9 @@ +#!/bin/bash +if pacman -Q virt-manager; then + exit 0 +else + sudo pacman -S --noconfirm virt-manager + + sudo systemctl enable --now libvirtd.socket + sudo usermod -aG libvirt vylpes +fi diff --git a/.config/yadm/bootstrap.d/08-nvim b/.config/yadm/bootstrap.d/08-nvim new file mode 100755 index 0000000..52dc2c4 --- /dev/null +++ b/.config/yadm/bootstrap.d/08-nvim @@ -0,0 +1,5 @@ +#!/bin/bash + +if command -v nvim >/dev/null 2>&1; then + nvim '+PlugInstall' '+qall' +fi diff --git a/.config/yadm/bootstrap.d/09-node b/.config/yadm/bootstrap.d/09-node new file mode 100755 index 0000000..1291307 --- /dev/null +++ b/.config/yadm/bootstrap.d/09-node @@ -0,0 +1,6 @@ +#!/bin/bash +if command -v nvm >/dev/null 2>&1; then + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash +else + exit 0 +fi diff --git a/.config/yadm/bootstrap.d/2q b/.config/yadm/bootstrap.d/2q new file mode 100644 index 0000000..a9bf588 --- /dev/null +++ b/.config/yadm/bootstrap.d/2q @@ -0,0 +1 @@ +#!/bin/bash diff --git a/.config/yadm/bootstrap.d/99-yadm b/.config/yadm/bootstrap.d/99-yadm new file mode 100755 index 0000000..18600ff --- /dev/null +++ b/.config/yadm/bootstrap.d/99-yadm @@ -0,0 +1 @@ +yadm remote set-url origin "ssh://git@ssh.git.vylpes.xyz:222/Vylpes/dotfiles.git" diff --git a/.config/yadm/files/login b/.config/yadm/files/login new file mode 100644 index 0000000..36e9ca2 --- /dev/null +++ b/.config/yadm/files/login @@ -0,0 +1,9 @@ +#%PAM-1.0 + +auth requisite pam_nologin.so +auth include system-local-login +auth optional pam_gnome_keyring.so +account include system-local-login +session include system-local-login +session optional pam_gnome_keyring.so auto_start +password include system-local-login diff --git a/.config/yadm/files/packages.txt b/.config/yadm/files/packages.txt new file mode 100644 index 0000000..e27787d --- /dev/null +++ b/.config/yadm/files/packages.txt @@ -0,0 +1,29 @@ +alacritty +arandr +autorandr +cups +discord +dunst +firefox +flameshot +gnome-keyring +i3-wm +i3lock +keepassxc +keepmenu +nextcloud-client +nitrogen +noto-fonts-emoji +pavucontrol +playerctl +pulseaudio-control +picom +polybar +rofi +tldr +ttf-font-awesome +ttf-hack +xclip +xorg-xinit +yt-dlp +zsh diff --git a/.zshrc b/.zshrc index 7156df5..92f9a62 100644 --- a/.zshrc +++ b/.zshrc @@ -15,3 +15,7 @@ alias lss="ls -lah" alias gco="git checkout" alias gcm="git commit -m" alias gss="git status -s" + +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion