Add USB install tooling, key/secret helpers, installer ISO, README
- install-system (nix run .#install): disk picker -> disk-ids.json, typed confirmation, disko, hardware config, host SSH key + secrets decrypt check, sbctl keys, nixos-install, password, repo copy - create-keys, set-password, secret-from-file, switch-system helpers - installer ISO (nix build .#iso) with the flake at /etc/nixos-config Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J1cugeLkfFLZMpiztQ8TyN
This commit is contained in:
3 files changed
+251
-4
No files matched your search
@@ -98,8 +98,8 @@ else
|
||||
fi
|
||||
if [ ! -e "$HOSTKEY.pub" ]; then
|
||||
ssh-keygen -y -f "$HOSTKEY" >"$HOSTKEY.pub"
|
||||
chmod 0644 "$HOSTKEY.pub"
|
||||
fi
|
||||
chmod 0644 "$HOSTKEY.pub"
|
||||
|
||||
if [ -d "$SBCTL/keys" ] && [ -f "$SBCTL/GUID" ]; then
|
||||
ok "Secure Boot keys exist, left untouched: $SBCTL"
|
||||
|
||||
@@ -232,6 +232,8 @@ sync_back() {
|
||||
|
||||
ensure_lock() {
|
||||
if [ -f "$FLAKE/flake.lock" ]; then
|
||||
# `nix run .#install` may have just created it: make sure git tracks it.
|
||||
git_add flake.lock
|
||||
return
|
||||
fi
|
||||
info "no flake.lock yet: locking all flake inputs (needs network, takes a minute)"
|
||||
@@ -618,7 +620,7 @@ could not log in). Nothing has been installed yet. Host public key:
|
||||
$HOST_PUB
|
||||
|
||||
Fix it with ONE of the following, then run the installer again with
|
||||
sudo install-system --host $HOST --flake $FLAKE --disko-mode mount
|
||||
sudo install-system --host $HOST --flake $FLAKE --keys-dir $KEYS_DIR --disko-mode mount
|
||||
|
||||
A) Encrypt the secrets for this key.
|
||||
1. Put the key above into secrets/secrets.nix (the 'host' variable).
|
||||
@@ -692,7 +694,7 @@ set_user_password() {
|
||||
info "no password secret: set the login password for $USER_NAME"
|
||||
local i
|
||||
for i in 1 2 3; do
|
||||
if nixos-enter --root "$MNT" -c "passwd $(printf '%q' "$USER_NAME")"; then
|
||||
if nixos-enter --root "$MNT" -c "/nix/var/nix/profiles/system/sw/bin/passwd $(printf '%q' "$USER_NAME")"; then
|
||||
ok "password set"
|
||||
return
|
||||
fi
|
||||
@@ -716,7 +718,7 @@ copy_repo_to_home() {
|
||||
chown "$USER_UID:100" "$home"
|
||||
while IFS= read -r m; do
|
||||
chown "$USER_UID:100" "$m"
|
||||
done < <(findmnt -rn -o TARGET | awk -v h="$home/" 'index($0, h) == 1 && substr($0, length(h) + 1) !~ /\//')
|
||||
done < <(findmnt -ln -o TARGET | awk -v h="$home/" 'index($0, h) == 1 && substr($0, length(h) + 1) !~ /\//')
|
||||
if [ -d "$home/Games" ]; then
|
||||
install -d -m 0755 -o "$USER_UID" -g 100 "$home/Games/SteamLibrary"
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user