From 820328421e7eadbc0959a7e8a48a6fcfa0b490fb Mon Sep 17 00:00:00 2001 From: beatzaplenty Date: Mon, 21 Jul 2025 18:40:52 +1000 Subject: [PATCH] modified: installer.nix --- installer.nix | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/installer.nix b/installer.nix index 0df1b52..6af557b 100644 --- a/installer.nix +++ b/installer.nix @@ -15,7 +15,7 @@ git curl parted e2fsprogs btrfs-progs util-linux ]; - environment.etc."flake-url".text = "git+https://gitea.lan.ddnsgeek.com/beatzaplenty/nixos.git?ref=main#nixos"; +# environment.etc."flake-url".text = "git+https://gitea.lan.ddnsgeek.com/beatzaplenty/nixos.git?ref=main#nixos"; environment.etc."git-credentials".text = "https://beatzaplenty:2b7e178eeee4af437fc721295d59e9e19366fd02@gitea.lan.ddnsgeek.com"; @@ -34,7 +34,31 @@ environment.etc."git-credentials".text = #!/run/current-system/sw/bin/bash set -eux - + set -euo pipefail + +FLAKE_BASE_URL="git+https://gitea.lan.ddnsgeek.com/beatzaplenty/nixos.git" + +# Menu options +options=("nixos" "docker" "server" "nix-cache" "nix-minimal") + +echo "Choose the flake profile to install:" +select choice in "${options[@]}"; do + if [[ -n "$choice" ]]; then + echo "You selected: $choice" + break + else + echo "Invalid selection. Try again." + fi +done + +echo "Starting install with flake: ${FLAKE_BASE_URL}#${choice}" + +# Optional: confirm before proceeding +read -rp "Proceed with installation? (y/N): " confirm +if [[ ! "$confirm" =~ ^[Yy]$ ]]; then + echo "Aborted." + exit 1 +fi parted -s /dev/sda -- mklabel msdos @@ -48,7 +72,7 @@ environment.etc."git-credentials".text = mount /dev/disk/by-label/nixos /mnt mkdir -p /mnt/install-tmp export TMPDIR=/mnt/install-tmp - nixos-install --flake "$(cat /etc/flake-url)" --no-root-password --no-write-lock-file + nixos-install --flake "${FLAKE_BASE_URL}#${choice}" --no-root-password --no-write-lock-file rm -rf /mnt/install-tmp sleep 10 reboot