updates for script
This commit is contained in:
+16
-3
@@ -18,12 +18,19 @@
|
||||
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
AGE_KEY_FILE="/keys.txt"
|
||||
|
||||
echo "nixos bootstrap installer =="
|
||||
|
||||
# --- input ---
|
||||
read -rp "hostname: " HOSTNAME
|
||||
read -rsp "age key (will not be echoed): " AGE_KEY
|
||||
#read -rp "age key (will not be echoed): " AGE_KEY
|
||||
if [[ ! -f "$AGE_KEY_FILE" ]]; then
|
||||
echo "cannot find age keyfile"
|
||||
exit 1
|
||||
fi
|
||||
AGE_KEY="$(cat "$AGE_KEY_FILE")"
|
||||
|
||||
echo
|
||||
|
||||
echo
|
||||
@@ -47,9 +54,13 @@ if [[ "$MODE" == "1" ]]; then
|
||||
echo "running disko (THIS WILL DESTROY DISKS)..."
|
||||
echo "make sure /dev/disk/by-id is correct in your host config!"
|
||||
|
||||
nix run github:nix-community/disko -- \
|
||||
# nix run github:nix-community/disko --extra-experimental-features "nix-command flakes" -- \
|
||||
# --mode destroy,format,mount \
|
||||
# --flake .#"${HOSTNAME}"
|
||||
|
||||
nix run github:nix-community/disko --extra-experimental-features "nix-command flakes" -- \
|
||||
--mode destroy,format,mount \
|
||||
--flake .#"${HOSTNAME}"
|
||||
/bootstrap_nix/hosts/nixos/$HOSTNAME/disko.nix
|
||||
|
||||
elif [[ "$MODE" == "2" ]]; then
|
||||
echo
|
||||
@@ -75,6 +86,8 @@ mkdir -p /mnt/home/blake/.config/sops/age
|
||||
# --- move config ---
|
||||
echo "moving nix config into /mnt/home/blake/.nix ..."
|
||||
mv /bootstrap_nix /mnt/home/blake/.nix
|
||||
echo "moving hardware into /mnt/home/blake/.nix/hosts/nixos/$HOSTNAME ..."
|
||||
cp /mnt/etc/nixos/hardware-configuration.nix /mnt/home/blake/.nix/hosts/nixos/$HOSTNAME
|
||||
|
||||
# --- write age key ---
|
||||
echo "writing age key..."
|
||||
|
||||
Reference in New Issue
Block a user