From 6400b58390fcb2757e58812dee45d5c0c02e7bc9 Mon Sep 17 00:00:00 2001 From: Thilo Billerbeck Date: Fri, 8 Nov 2024 02:09:50 +0100 Subject: [PATCH] add bootstrap script --- bootstrap.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 bootstrap.sh diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 index 0000000..afd0086 --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,24 @@ +#!/bin/env bash + +# Install nix if not already installed +if ! command -v nix &> /dev/null +then + echo "Nix is not installed. Installing..." + curl -sSf -L https://install.lix.systems/lix | sh -s -- install + echo "Nix installed. Please restart your shell." + exit 0 +else + echo "Nix is already installed." +fi + +# Clone the dotfiles repo into the proper directory +if [ ! -d "$HOME/.config/home-manager" ]; then + echo "Cloning dotfiles repo..." + git clone https://github.com/thilobillerbeck/dotfiles.git $HOME/.config/home-manager +else + echo "Dotfiles repo already cloned." +fi + +# Install home-manager +cd $HOME/.config/home-manager +nix run .#homeConfigurations.$USER@$(hostname).activationPackage \ No newline at end of file