modified: installer.nix

This commit is contained in:
2025-07-21 18:40:52 +10:00
parent 92a36d87d9
commit 820328421e
+27 -3
View File
@@ -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