Compare commits
	
		
			No commits in common. "c828dfc2e68ce8d787e8c968c9926e65932f5421" and "67ffb18e0307a693cae785066da069e5c15fae52" have entirely different histories.
		
	
	
		
			c828dfc2e6
			...
			67ffb18e03
		
	
		
@ -1,4 +1,4 @@
 | 
				
			|||||||
#!/usr/bin/env bash
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
HASH="%C(yellow)%h%C(reset)"
 | 
					HASH="%C(yellow)%h%C(reset)"
 | 
				
			||||||
RELATIVE_TIME="%C(green)%ar%C(reset)"
 | 
					RELATIVE_TIME="%C(green)%ar%C(reset)"
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										63
									
								
								install.sh
									
									
									
									
									
								
							
							
						
						
									
										63
									
								
								install.sh
									
									
									
									
									
								
							@ -1,65 +1,38 @@
 | 
				
			|||||||
#!/usr/bin/env bash
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					 | 
				
			||||||
function install_pkg() {
 | 
					 | 
				
			||||||
  if hash apt-get 2>/dev/null; then
 | 
					 | 
				
			||||||
    sudo -n apt-get update
 | 
					 | 
				
			||||||
    sudo -n DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ${@}
 | 
					 | 
				
			||||||
    return
 | 
					 | 
				
			||||||
  fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  if hash nix 2>/dev/null; then
 | 
					 | 
				
			||||||
    echo "INSTALL ${@} yourself with nix"
 | 
					 | 
				
			||||||
    return
 | 
					 | 
				
			||||||
  fi
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
function setup_ssh() {
 | 
					function setup_ssh() {
 | 
				
			||||||
  configfile=~/.ssh/config
 | 
					 | 
				
			||||||
  if grep -Fxq "# dotfiles installed" ${configfile}; then
 | 
					 | 
				
			||||||
    return
 | 
					 | 
				
			||||||
  fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  mkdir -p ~/.ssh
 | 
					  mkdir -p ~/.ssh
 | 
				
			||||||
  touch ${configfile}
 | 
					  touch ~/.ssh/config
 | 
				
			||||||
  chmod 644 ${configfile}
 | 
					  chmod 644 ~/.ssh/config
 | 
				
			||||||
  cat << EOF >> ${configfile}
 | 
					  cat << EOF >> ~/.ssh/config
 | 
				
			||||||
Include ${HOME}/dotfiles/ssh.config
 | 
					Include ${HOME}/dotfiles/ssh.config
 | 
				
			||||||
# dotfiles installed
 | 
					 | 
				
			||||||
EOF
 | 
					EOF
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function setup_git() {
 | 
					function setup_git() {
 | 
				
			||||||
  configfile=~/.gitconfig
 | 
					  cat << EOF > ~/.gitconfig
 | 
				
			||||||
  if grep -Fxq "# dotfiles installed" ${configfile}; then
 | 
					 | 
				
			||||||
    return
 | 
					 | 
				
			||||||
  fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  cat << EOF > ${configfile}
 | 
					 | 
				
			||||||
[include]
 | 
					[include]
 | 
				
			||||||
  path = ${HOME}/dotfiles/git/gitconfig
 | 
					  path = ${HOME}/dotfiles/git/gitconfig
 | 
				
			||||||
[core]
 | 
					[core]
 | 
				
			||||||
  excludesfile = ${HOME}/dotfiles/git/gitignore_global
 | 
					  excludesfile = ${HOME}/dotfiles/git/gitignore_global
 | 
				
			||||||
# dotfiles installed
 | 
					 | 
				
			||||||
EOF
 | 
					EOF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  setup_ssh
 | 
					  setup_ssh
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function setup_tmux() {
 | 
					function setup_tmux() {
 | 
				
			||||||
  configfile=~/.tmux.conf
 | 
					  sudo -n apt-get update
 | 
				
			||||||
  if grep -Fxq "# dotfiles installed" ${configfile}; then
 | 
					  sudo -n DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
 | 
				
			||||||
    return
 | 
					    tmux
 | 
				
			||||||
  fi
 | 
					  cat << EOF > ~/.tmux.conf
 | 
				
			||||||
 | 
					 | 
				
			||||||
  install_pkg tmux
 | 
					 | 
				
			||||||
  cat << EOF > ${configfile}
 | 
					 | 
				
			||||||
source ${HOME}/dotfiles/tmux/tmux.conf
 | 
					source ${HOME}/dotfiles/tmux/tmux.conf
 | 
				
			||||||
# dotfiles.installed
 | 
					 | 
				
			||||||
EOF
 | 
					EOF
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function setup_fish() {
 | 
					function setup_fish() {
 | 
				
			||||||
  install_pkg fish
 | 
					  sudo -n apt-get update
 | 
				
			||||||
 | 
					  sudo -n DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
 | 
				
			||||||
 | 
					    fish
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  USER=`whoami`
 | 
					  USER=`whoami`
 | 
				
			||||||
  sudo -n chsh $USER -s $(which fish)
 | 
					  sudo -n chsh $USER -s $(which fish)
 | 
				
			||||||
@ -72,7 +45,9 @@ function setup_fish() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function setup_nvim() {
 | 
					function setup_nvim() {
 | 
				
			||||||
  install_pkg neovim
 | 
					  sudo -n apt-get update
 | 
				
			||||||
 | 
					  sudo -n DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
 | 
				
			||||||
 | 
					    neovim
 | 
				
			||||||
  mkdir -p ~/.config/nvim/
 | 
					  mkdir -p ~/.config/nvim/
 | 
				
			||||||
  ln -s ~/dotfiles/init.vim ~/.config/nvim/init.vim
 | 
					  ln -s ~/dotfiles/init.vim ~/.config/nvim/init.vim
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -85,12 +60,10 @@ function setup_nvim() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
function main() {
 | 
					function main() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  install_pkg locales less
 | 
					  sudo apt-get install locales less
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if [[ ${REMOTE_CONTAINERS} || ${DEVCONTAINER} ]]; then
 | 
					  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
 | 
					 | 
				
			||||||
  fi
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  setup_fish
 | 
					  setup_fish
 | 
				
			||||||
  setup_ssh
 | 
					  setup_ssh
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
#!/usr/bin/env bash
 | 
					#!/bin/bash
 | 
				
			||||||
set -e
 | 
					set -e
 | 
				
			||||||
cd "$(dirname "$0")/.."
 | 
					cd "$(dirname "$0")/.."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user