dotfiles/scripts/bootstrap-install.sh
DannyDannyDanny d4dbd73a8c feat(nixos): add phantom-ship host and streamline server installer
- New host config: phantom-ship.nix (SSH, auto-rebuild, nix-ld, Ethernet)
- Hardware stub: phantom-ship-hardware.nix (replaced by install script)
- Add phantom-ship to flake.nix with home-manager
- Install script now auto-provisions post-install:
  - Clones dotfiles to /etc/dotfiles
  - Installs SSH public key (SSH_PUBKEY_FILE env var)
  - Generates hardware config
  - Supports INSTALLER_HOSTNAME and INSTALLER_DISK env vars
- Fix bootstrap-install.sh default branch to main
- Update CLAUDE.md and server-installer-usb.md
2026-03-31 11:37:15 +02:00

22 lines
932 B
Bash
Executable file

#!/bin/bash
# Fetch with curl and run to install NixOS (clone + run nixos-server-install.sh).
# On the live system, run only:
# curl -sL https://raw.githubusercontent.com/DannyDannyDanny/dotfiles/main/scripts/bootstrap-install.sh | sudo bash
#
# Optional: REPO_URL=... BRANCH=... (default repo and server-installer-usb)
set -euo pipefail
REPO_URL="${REPO_URL:-https://github.com/DannyDannyDanny/dotfiles.git}"
BRANCH="${BRANCH:-main}"
DEST="/tmp/dotfiles"
INSTALL_SCRIPT="$DEST/scripts/nixos-server-install.sh"
if [[ ! -f "$INSTALL_SCRIPT" ]]; then
echo "Cloning $REPO_URL ($BRANCH) to $DEST..."
nix run --extra-experimental-features "nix-command flakes" nixpkgs#git -- clone --branch "$BRANCH" "$REPO_URL" "$DEST"
fi
cd "$DEST"
# Use /dev/tty for stdin so prompts work when bootstrap is run as: curl ... | sudo bash
[[ "$EUID" -ne 0 ]] && exec sudo bash "$INSTALL_SCRIPT" < /dev/tty
exec bash "$INSTALL_SCRIPT" < /dev/tty