nixcfg/flake/clean-install.sh

19 lines
561 B
Bash
Raw Permalink Normal View History

2024-07-17 11:07:29 -04:00
read -p "Which host are you installing? " HOST
FLAKE=github:alyraffauf/nixcfg#$HOST
2024-07-17 11:07:29 -04:00
echo "Installing from $FLAKE"
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
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
# 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