This commit is contained in:
Menno van Leeuwen 2024-02-19 14:20:08 +01:00
parent a4aba8311e
commit 3d668a0ffe
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE
2 changed files with 23 additions and 4 deletions

View File

@ -1,4 +1,13 @@
# Run the following command to begin
# Menno's dotfiles
Welcome to my dotfiles repository. This repository contains my dotfiles and a setup script to install them on a new system.
It should work on any system that supports nix and home-manager.
## Install nix, home-manager and dotfiles on a new system
This script will install nix, home-manager and my dotfiles on a new system.
Tested on:
- Ubuntu 22.04
```
curl -sSL https://raw.githubusercontent.com/vleeuwenmenno/dotfiles/master/setup.sh | bash -s -- "--install"
```

View File

@ -85,6 +85,11 @@ home_manager_setup() {
fi
}
switch_to_home_manager() {
echo 'Running home-manager switch...'
home-manager switch --flake ~/.dotfiles
}
# Check if parameter is help, continue or initial
if [ "$1" == "-i" ] || [ "$1" == "--install" ]; then
# Check if .dotfiles exists, if so stop
@ -105,15 +110,20 @@ if [ "$1" == "-i" ] || [ "$1" == "--install" ]; then
# Clone dotfiles
clone_dotfiles
echo 'Nix and dotfiles are installed, running initial home-manager setup...'
echo 'Nix and dotfiles are installed'
chmod +x ~/.dotfiles/setup.sh
bash -c "~/.dotfiles/setup.sh -c"
elif [ "$1" == "-c" ] || [ "$1" == "--continue" ]; then
echo 'Installing home-manager ...'
# Run initial home-manager setup
home_manager_setup
# Run initial home-manager switch
home-manager switch --flake ~/.dotfiles
echo 'Please restart your shell and enjoy your new environment!'
switch_to_home_manager
# We're done here!
echo 'Installation complete! Please restart your shell and enjoy!'
else
help
fi