Add installpackages, installdotfiles, gensshkey scripts

This commit is contained in:
Rob Watson 2021-04-01 22:32:07 +02:00
parent 1ea4e04727
commit 391076bda4
3 changed files with 59 additions and 0 deletions

6
script/gensshkey Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
#
# Generate a new SSH keypair.
# https://medium.com/risan/upgrade-your-ssh-key-to-ed25519-c6e8d60d3c54
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob@$(hostname -s)"

32
script/installdotfiles Executable file
View File

@ -0,0 +1,32 @@
#!/usr/bin/env bash
#
# Set up basic symlinks and directory structure when installing dotfiles.
set -e
# General
mkdir -p $HOME/dev
ln -s $HOME/dev/dotfiles/script $HOME/script
# ZSH
mkdir -p $HOME/.config/zsh/functions
ln -s $HOME/dev/dotfiles/zshenv $HOME/.zshenv
ln -s $HOME/dev/dotfiles/zshrc $HOME/.config/zsh/.zshrc
# Tmux
ln -s $HOME/dev/dotfiles/tmux.conf $HOME/.tmux.conf
# Vim
mkdir -p $HOME/.vim/pack/git-plugins/{opt,start}
ln -s $HOME/dev/dotfiles/vimrc $HOME/.vimrc
ln -s $HOME/dev/dotfiles/vim/after $HOME/.vim/after
# Git
ln -s $HOME/dev/dotfiles/gitconfig $HOME/.gitconfig
mkdir -p $HOME/.config/git
ln -s $HOME/dev/dotfiles/gitignore $HOME/.config/git/ignore
# Alacritty
ln -s $HOME/dev/dotfiles/alacritty.yml $HOME/.config/alacritty.yml
echo "Done"

21
script/installpackages Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
#
# Install packages for a new Arch or Manjaro installation. Requires sudo
if [[ $euid > 0 ]]; then
echo "requires administrative privileges"
exit 1
fi
pacman -S --needed base-devel \
git \
exa \
fzf \
tmux \
ttf-ubuntu-font-family # Ubuntu Mono font for Alacritty
# https://rustup.rs/
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# https://github.com/dandavison/delta#installation
cargo install git-delta