work/user.sh

79 lines
2.5 KiB
Bash
Raw Permalink Normal View History

2020-04-11 18:55:50 +00:00
#!/bin/bash
2020-04-11 19:27:32 +00:00
set -x
2020-04-11 18:55:50 +00:00
TD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)"
2020-05-26 07:07:46 +00:00
U="user"
2020-04-11 19:18:22 +00:00
2020-05-26 07:07:46 +00:00
export HOME=/home/user
export USER=user
2020-04-11 23:11:49 +00:00
export LC_ALL=en_US
export LANG=en_US.UTF-8
2020-04-11 18:55:50 +00:00
# original home
2020-04-11 19:18:22 +00:00
OH="/hosthome"
2020-04-11 18:55:50 +00:00
# link ~/.home to original home
2020-04-11 19:18:22 +00:00
ln -s "/hosthome" $HOME/.home
2020-04-11 18:55:50 +00:00
2021-10-14 09:04:14 +00:00
cd $HOME && ls -tla
2020-04-11 20:55:42 +00:00
2020-05-26 07:07:46 +00:00
# /nix is already created for us and chowned to us by now:
curl -L https://nixos.org/nix/install | sh
2020-04-11 23:11:49 +00:00
2020-05-26 07:07:46 +00:00
source /home/user/.nix-profile/etc/profile.d/nix.sh
2020-04-11 23:11:49 +00:00
2020-05-26 07:07:46 +00:00
# this should install all the packages from the config.nix:
2021-10-14 09:04:14 +00:00
nix-env -iA nixpkgs.work
nix-env --set-flag priority 7 workpackages
2020-05-26 07:07:46 +00:00
# FIXME have this pull from synced dir instead
# oh-my-zsh
curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh > /tmp/installomz.sh
export ZSH="$HOME/.zsh"
2020-07-08 07:26:10 +00:00
export KEEP_ZSHRC=yes
2020-05-26 07:07:46 +00:00
zsh /tmp/installomz.sh && rm /tmp/installomz.sh
2020-05-16 11:28:48 +00:00
###############################################################################
##### Personal Config
###############################################################################
# I had envisioned this image as adaptable to other users but I've decided
# to abandon that hope and hardcode my own values in here.
git config --global user.email sneak@sneak.berlin
git config --global user.name sneak
2020-05-26 07:07:46 +00:00
mkdir -p ~/.paths
# TODO FIXME change the syncthing paths on las1 when convenient sometime
2021-10-14 09:04:14 +00:00
ln -s ~/.home/Library/Syncthing/folders/sync ~/.paths/sneak-sync
ln -s ~/.home/Library/Syncthing/folders/scratch ~/.paths/sneak-scratch
ln -s ~/.home/Library/Syncthing/folders/sneak-docs ~/.paths/sneak-docs
2020-05-26 07:07:46 +00:00
ln -s ~/.paths/sneak-docs ~/Documents
ln -s ~/.paths/sneak-scratch/dev ~/dev
ln -s ~/.paths/sneak-sync/dotfiles/weechat ~/.weechat
ln -s ~/.paths/sneak-sync/ssh/config ~/.ssh/config
# link in ssh key from original home
mkdir -p ~/.ssh
ln -s ~/.paths/sneak-sync/secrets/ssh/pixel16/id_rsa ~/.ssh/id_rsa
ln -s ~/.paths/sneak-sync/secrets/ssh/pixel16/id_rsa.pub ~/.ssh/id_rsa.pub
2021-10-14 09:04:14 +00:00
# vim plug preinstallation
# newline is to fix "hit ENTER" issue when it can't find the colorscheme file
# which PlugInstall is about to install
# this needs to happen after the linking above
echo "" | vim +PlugInstall +qall
vim +GoInstallBinaries +qall
vim +PlugInstall +qall
rm ~/.vimrc
ln -s ~/.paths/sneak-sync/dotfiles/vim/vimrc ~/.vimrc
mkdir -p ~/.config/nvim
ln -s ~/.paths/sneak-sync/dotfiles/vim/vimrc ~/.config/nvim/init.vim
mkdir -p ~/.local/share/terraform/plugins/registry.terraform.io/dmacvicar/libvirt/0.6.2/linux_amd64
cd ~/.local/share/terraform/plugins/registry.terraform.io/dmacvicar/libvirt/0.6.2/linux_amd64