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)"
 | 
			
		||||
RELATIVE_TIME="%C(green)%ar%C(reset)"
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										59
									
								
								install.sh
									
									
									
									
									
								
							
							
						
						
									
										59
									
								
								install.sh
									
									
									
									
									
								
							@ -1,65 +1,38 @@
 | 
			
		||||
#!/usr/bin/env 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
 | 
			
		||||
}
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
function setup_ssh() {
 | 
			
		||||
  configfile=~/.ssh/config
 | 
			
		||||
  if grep -Fxq "# dotfiles installed" ${configfile}; then
 | 
			
		||||
    return
 | 
			
		||||
  fi
 | 
			
		||||
 | 
			
		||||
  mkdir -p ~/.ssh
 | 
			
		||||
  touch ${configfile}
 | 
			
		||||
  chmod 644 ${configfile}
 | 
			
		||||
  cat << EOF >> ${configfile}
 | 
			
		||||
  touch ~/.ssh/config
 | 
			
		||||
  chmod 644 ~/.ssh/config
 | 
			
		||||
  cat << EOF >> ~/.ssh/config
 | 
			
		||||
Include ${HOME}/dotfiles/ssh.config
 | 
			
		||||
# dotfiles installed
 | 
			
		||||
EOF
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function setup_git() {
 | 
			
		||||
  configfile=~/.gitconfig
 | 
			
		||||
  if grep -Fxq "# dotfiles installed" ${configfile}; then
 | 
			
		||||
    return
 | 
			
		||||
  fi
 | 
			
		||||
 | 
			
		||||
  cat << EOF > ${configfile}
 | 
			
		||||
  cat << EOF > ~/.gitconfig
 | 
			
		||||
[include]
 | 
			
		||||
  path = ${HOME}/dotfiles/git/gitconfig
 | 
			
		||||
[core]
 | 
			
		||||
  excludesfile = ${HOME}/dotfiles/git/gitignore_global
 | 
			
		||||
# dotfiles installed
 | 
			
		||||
EOF
 | 
			
		||||
 | 
			
		||||
  setup_ssh
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function setup_tmux() {
 | 
			
		||||
  configfile=~/.tmux.conf
 | 
			
		||||
  if grep -Fxq "# dotfiles installed" ${configfile}; then
 | 
			
		||||
    return
 | 
			
		||||
  fi
 | 
			
		||||
 | 
			
		||||
  install_pkg tmux
 | 
			
		||||
  cat << EOF > ${configfile}
 | 
			
		||||
  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
 | 
			
		||||
# dotfiles.installed
 | 
			
		||||
EOF
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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`
 | 
			
		||||
  sudo -n chsh $USER -s $(which fish)
 | 
			
		||||
@ -72,7 +45,9 @@ function setup_fish() {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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/
 | 
			
		||||
  ln -s ~/dotfiles/init.vim ~/.config/nvim/init.vim
 | 
			
		||||
 | 
			
		||||
@ -85,12 +60,10 @@ function setup_nvim() {
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
  sudo locale-gen
 | 
			
		||||
  fi
 | 
			
		||||
 | 
			
		||||
  setup_fish
 | 
			
		||||
  setup_ssh
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
#!/usr/bin/env bash
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
set -e
 | 
			
		||||
cd "$(dirname "$0")/.."
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user