summaryrefslogtreecommitdiff
path: root/scripts/provision.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/provision.sh')
-rw-r--r--scripts/provision.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/scripts/provision.sh b/scripts/provision.sh
new file mode 100644
index 0000000..79d5558
--- /dev/null
+++ b/scripts/provision.sh
@@ -0,0 +1,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://github.com/compromyse/dotfiles $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