65 lines
1.1 KiB
Bash
Executable File
65 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
function install_dependencies() {
|
|
sudo -n apt-get update
|
|
sudo -n DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
|
fish \
|
|
neovim
|
|
}
|
|
|
|
function setup_ssh() {
|
|
mkdir -p ~/.ssh
|
|
touch ~/.ssh/config
|
|
chmod 644 ~/.ssh/config
|
|
}
|
|
|
|
function setup_git() {
|
|
cat << EOF > ~/.gitconfig
|
|
[include]
|
|
path = ${HOME}/dotfiles/git/gitconfig
|
|
[core]
|
|
excludesfile = ${HOME}/dotfiles/git/gitignore_global
|
|
EOF
|
|
|
|
setup_ssh
|
|
cat << EOF >> ~/.ssh/config
|
|
Host *
|
|
AddKeysToAgent yes
|
|
IdentityFile ~/.ssh/thomas_rsa
|
|
VisualHostKey yes
|
|
Host github.com
|
|
User git
|
|
Host gitea
|
|
HostName git.thomasloven.com
|
|
User git
|
|
EOF
|
|
|
|
}
|
|
|
|
USER=`whoami`
|
|
|
|
if [[ ${REMOTE_CONTAINERS} || ${DEVCONTAINER} ]]; then
|
|
|
|
echo "INSTALLING IN DEVCONTAINER"
|
|
|
|
fi
|
|
|
|
install_dependencies
|
|
|
|
sudo -n chsh $USER -s $(which fish)
|
|
echo "exec $(which fish) -l" >> ~/.profile
|
|
echo "exec $(which fish) -l" >> ~/.bashrc
|
|
echo "exec $(which fish) -l" >> ~/.zshrc
|
|
|
|
echo "sv_SE.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
|
|
sudo locale-gen
|
|
|
|
setup_ssh
|
|
setup_git
|
|
|
|
mkdir -p ~/.config/
|
|
ln -s ~/dotfiles/fish ~/.config/fish
|
|
mkdir -p ~/.config/nvim/
|
|
ln -s ~/dotfiles/init.vim ~/.config/nvim/init.vim
|
|
|