aboutsummaryrefslogtreecommitdiff
path: root/scripts/provision-user.sh
blob: 7e8c40b57f2a706ab48d6dfec6f87d693989af11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash

set -xe

CONFIG=vm

sh <(curl -L https://nixos.org/nix/install) --no-daemon

. "$HOME/.nix-profile/etc/profile.d/nix.sh"

nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
nix-channel --update

nix-shell "<home-manager>" -A install
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"

git clone https://git.compromyse.xyz/me/dotfiles.git $HOME/.config/home-manager/dotfiles
git clone https://github.com/tmux-plugins/tpm $HOME/.tmux/plugins/tpm

rm $HOME/.config/home-manager/home.nix
ln -s $HOME/.config/home-manager/dotfiles/machines/$CONFIG/home.nix $HOME/.config/home-manager/home.nix

sudo apt-get purge -y git
sudo apt-get autoremove -y

home-manager build
home-manager switch -b backup

rm $HOME/result

~/.tmux/plugins/tpm/bin/install_plugins