2024-07-17 11:07:29 -04:00
|
|
|
read -p "Which host are you installing? " HOST
|
2024-07-09 19:17:53 -04:00
|
|
|
|
|
|
|
FLAKE=github:alyraffauf/nixcfg#$HOST
|
2024-07-17 11:07:29 -04:00
|
|
|
echo "Installing from $FLAKE"
|
2024-07-09 19:17:53 -04:00
|
|
|
|
|
|
|
echo "Warning: Running this script will wipe the currently installed system."
|
|
|
|
read -p "Do you want to continue? (y/n): " answer
|
|
|
|
|
|
|
|
if [ "$answer" != "y" ]; then
|
2024-07-09 23:34:43 -04:00
|
|
|
echo "Aborted."
|
|
|
|
exit 0
|
2024-07-09 19:17:53 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
sudo nix --experimental-features "nix-command flakes" run \
|
2024-07-09 23:34:43 -04:00
|
|
|
github:nix-community/disko -- --mode disko --flake $FLAKE
|
2024-07-09 19:17:53 -04:00
|
|
|
|
|
|
|
# Install NixOS with the updated flake input and root settings
|
2024-07-09 23:34:43 -04:00
|
|
|
sudo nixos-install --no-root-password --root /mnt --flake $FLAKE
|