79 lines
1.5 KiB
Bash
Executable File
79 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
function setup_ssh() {
|
|
mkdir -p ~/.ssh
|
|
touch ~/.ssh/config
|
|
chmod 644 ~/.ssh/config
|
|
cat << EOF >> ~/.ssh/config
|
|
Include ${HOME}/dotfiles/ssh.config
|
|
EOF
|
|
}
|
|
|
|
function setup_git() {
|
|
cat << EOF > ~/.gitconfig
|
|
[include]
|
|
path = ${HOME}/dotfiles/git/gitconfig
|
|
[core]
|
|
excludesfile = ${HOME}/dotfiles/git/gitignore_global
|
|
EOF
|
|
|
|
setup_ssh
|
|
}
|
|
|
|
function setup_tmux() {
|
|
sudo -n apt-get update
|
|
sudo -n DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
|
tmux
|
|
cat << EOF > ~/.tmux.conf
|
|
source ${HOME}/dotfiles/tmux/tmux.conf
|
|
EOF
|
|
}
|
|
|
|
function setup_fish() {
|
|
sudo -n apt-get update
|
|
sudo -n DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
|
fish
|
|
|
|
USER=`whoami`
|
|
sudo -n chsh $USER -s $(which fish)
|
|
# Force fish shell for devcontainers
|
|
echo "exec $(which fish) -l" >> ~/.profile
|
|
echo "exec $(which fish) -l" >> ~/.bashrc
|
|
echo "exec $(which fish) -l" >> ~/.zshrc
|
|
|
|
mkdir -p ~/.config/
|
|
ln -s ~/dotfiles/fish ~/.config/fish
|
|
}
|
|
|
|
function setup_nvim() {
|
|
sudo -n apt-get update
|
|
sudo -n DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
|
neovim
|
|
mkdir -p ~/.config/nvim/
|
|
ln -s ~/dotfiles/init.vim ~/.config/nvim/init.vim
|
|
}
|
|
|
|
function main() {
|
|
|
|
echo "sv_SE.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
|
|
sudo locale-gen
|
|
|
|
setup_fish
|
|
setup_ssh
|
|
setup_git
|
|
|
|
if [[ ${REMOTE_CONTAINERS} || ${DEVCONTAINER} ]]; then
|
|
|
|
echo "INSTALLING IN DEVCONTAINER"
|
|
|
|
echo "set -x EDITOR code" >> ~/.config/fish/local.fish
|
|
|
|
else
|
|
setup_tmux
|
|
setup_nvim
|
|
fi
|
|
|
|
}
|
|
|
|
main $@
|