Clening of setup script. Add ssh config
This commit is contained in:
parent
2d63016f8a
commit
497f1b1fa6
55
install.sh
55
install.sh
@ -4,13 +4,17 @@ function install_dependencies() {
|
|||||||
sudo -n apt-get update
|
sudo -n apt-get update
|
||||||
sudo -n DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
sudo -n DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||||
fish \
|
fish \
|
||||||
neovim
|
neovim \
|
||||||
|
tmux
|
||||||
}
|
}
|
||||||
|
|
||||||
function setup_ssh() {
|
function setup_ssh() {
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
touch ~/.ssh/config
|
touch ~/.ssh/config
|
||||||
chmod 644 ~/.ssh/config
|
chmod 644 ~/.ssh/config
|
||||||
|
cat << EOF >> ~/.ssh/config
|
||||||
|
Include ${HOME}/dotfiles/ssh.config
|
||||||
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
function setup_git() {
|
function setup_git() {
|
||||||
@ -22,21 +26,32 @@ function setup_git() {
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
setup_ssh
|
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
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setup_tmux() {
|
||||||
|
cat << EOF > ~/.tmux.conf
|
||||||
|
source ${HOME}/dotfiles/tmux/tmux.conf
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
function setup_fish() {
|
||||||
USER=`whoami`
|
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() {
|
||||||
|
mkdir -p ~/.config/nvim/
|
||||||
|
ln -s ~/dotfiles/init.vim ~/.config/nvim/init.vim
|
||||||
|
}
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
|
||||||
if [[ ${REMOTE_CONTAINERS} || ${DEVCONTAINER} ]]; then
|
if [[ ${REMOTE_CONTAINERS} || ${DEVCONTAINER} ]]; then
|
||||||
|
|
||||||
@ -46,19 +61,15 @@ fi
|
|||||||
|
|
||||||
install_dependencies
|
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
|
echo "sv_SE.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
|
||||||
sudo locale-gen
|
sudo locale-gen
|
||||||
|
|
||||||
|
setup_fish
|
||||||
setup_ssh
|
setup_ssh
|
||||||
setup_git
|
setup_git
|
||||||
|
setup_tmux
|
||||||
|
setup_nvim
|
||||||
|
}
|
||||||
|
|
||||||
mkdir -p ~/.config/
|
main $@
|
||||||
ln -s ~/dotfiles/fish ~/.config/fish
|
|
||||||
mkdir -p ~/.config/nvim/
|
|
||||||
ln -s ~/dotfiles/init.vim ~/.config/nvim/init.vim
|
|
||||||
|
|
||||||
|
9
ssh.config
Normal file
9
ssh.config
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
Host *
|
||||||
|
AddKeysToAgent yes
|
||||||
|
IdentityFile ~/.ssh/thomas_rsa
|
||||||
|
VisualHostKey yes
|
||||||
|
Host github.com
|
||||||
|
User git
|
||||||
|
Host gitea
|
||||||
|
HostName git.thomasloven.com
|
||||||
|
User git
|
@ -4,6 +4,9 @@ cd "$(dirname "$0")/.."
|
|||||||
|
|
||||||
docker build . -t dotfiles -f test/Dockerfile.devcontainer --force-rm
|
docker build . -t dotfiles -f test/Dockerfile.devcontainer --force-rm
|
||||||
|
|
||||||
docker run --rm -it -v $(pwd):/workspaces/test dotfiles zsh
|
docker run --rm -it \
|
||||||
|
-v $(pwd):/workspaces/test \
|
||||||
|
-v $(dirname $SSH_AUTH_SOCK):$(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK\
|
||||||
|
dotfiles zsh
|
||||||
|
|
||||||
docker rmi dotfiles
|
docker rmi dotfiles
|
||||||
|
Loading…
x
Reference in New Issue
Block a user