1 parent
80ec3dfdd3
commit
079cceb554
57 files changed
+4092
-538
No files matched your search
@@ -1,9 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
# install-system: install this flake onto the machine, from the NixOS installer.
|
||||
#
|
||||
# Flow: locate flake -> pick disks -> confirm -> disko -> hardware config ->
|
||||
# host SSH key (+ secrets check) -> Secure Boot keys -> nixos-install ->
|
||||
# password -> copy the repo into the new home directory.
|
||||
# Flow: locate flake -> pick disks -> evaluate the system (fetches every input)
|
||||
# -> confirm -> disko -> hardware config -> host SSH key (+ secrets check) ->
|
||||
# Secure Boot keys -> nixos-install -> password -> copy the repo into the new
|
||||
# home directory.
|
||||
set -euo pipefail
|
||||
|
||||
HOST=desktop
|
||||
@@ -450,6 +451,20 @@ eval_config() {
|
||||
ok "user $USER_NAME (uid $USER_UID), Secure Boot: $SB_ENABLE, secrets: $SECRETS_ENABLE"
|
||||
}
|
||||
|
||||
# config.my does not need every input. Evaluate the whole system now, so a
|
||||
# missing input (the private nvim one, fetched over SSH) stops the run before
|
||||
# disko wipes anything instead of after.
|
||||
check_inputs() {
|
||||
info "evaluating the whole system (fetches every input; nothing is changed yet)"
|
||||
"${NIX[@]}" eval --raw "$FLAKE#nixosConfigurations.$HOST.config.system.build.toplevel.drvPath" >/dev/null ||
|
||||
die "could not evaluate the system of $HOST; no disk has been touched.
|
||||
If the error above is about the private 'nvim' input: it is fetched over SSH, so
|
||||
root needs a key that can read git.faumaray.ru and that host's key in
|
||||
/root/.ssh/known_hosts (README, Install from USB, Path A), or use the custom
|
||||
ISO (Path B), which carries every input."
|
||||
ok "all inputs are available"
|
||||
}
|
||||
|
||||
# ---- confirmation ---------------------------------------------------------------
|
||||
|
||||
# Refuse to touch a disk that holds the live system, this flake or the keys.
|
||||
@@ -760,6 +775,7 @@ main() {
|
||||
ensure_lock
|
||||
select_disks
|
||||
eval_config
|
||||
check_inputs
|
||||
confirm
|
||||
run_disko
|
||||
gen_hardware_config
|
||||
|
||||
Reference in new issue
Block a user