aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/install-with-disko
diff options
context:
space:
mode:
authorMark Nipper <nipsy@bitgnome.net>2024-05-03 00:28:33 -0700
committerMark Nipper <nipsy@bitgnome.net>2024-05-03 00:28:33 -0700
commit62b28f7d84c422ab2c16f9a24aa6189a7dd57ac0 (patch)
tree371fcd983ca941102ece800f7e6bdaa8ed148b85 /scripts/install-with-disko
parentbb455452a10edc9294f4f8e34b62bf01e9906c0a (diff)
downloadnix-62b28f7d84c422ab2c16f9a24aa6189a7dd57ac0.tar
nix-62b28f7d84c422ab2c16f9a24aa6189a7dd57ac0.tar.gz
nix-62b28f7d84c422ab2c16f9a24aa6189a7dd57ac0.tar.bz2
nix-62b28f7d84c422ab2c16f9a24aa6189a7dd57ac0.tar.lz
nix-62b28f7d84c422ab2c16f9a24aa6189a7dd57ac0.tar.xz
nix-62b28f7d84c422ab2c16f9a24aa6189a7dd57ac0.tar.zst
nix-62b28f7d84c422ab2c16f9a24aa6189a7dd57ac0.zip
Add help
Diffstat (limited to '')
-rwxr-xr-xscripts/install-with-disko23
1 files changed, 20 insertions, 3 deletions
diff --git a/scripts/install-with-disko b/scripts/install-with-disko
index a6210b9..5845c2d 100755
--- a/scripts/install-with-disko
+++ b/scripts/install-with-disko
@@ -1,17 +1,34 @@
#!/usr/bin/env nix-shell
#!nix-shell -i zsh --packages rsync zsh
+setopt ERR_EXIT NO_UNSET PIPE_FAIL
+
# load module to parse command line arguments
zmodload zsh/zutil
# parse any possible additional drive declarations
-zparseopts -D -E -A opts -- -skip-disko h
+zparseopts -D -E -A opts -- -skip-disko h x
-setopt ERR_EXIT NO_UNSET PIPE_FAIL
-DIR="${0:h}"
+# enable XTRACE shell option for full debugging output of scripts
+if (( ${+opts[-x]} )); then
+ set -x
+fi
+DIR="${0:h}"
TARGET_HOST="${1:-}"
+if [[ -z "${TARGET_HOST}" ]] || (( ${+opts[-h]} )); then
+ <<EOF >&2
+usage: ${0:t} [ --skip-disko ] [ -h ] [ -x ] host
+
+ --skip-disko skip running presumably already run disko step
+ -h this message
+ -x enable shell debug
+ host the host to install from our flake
+EOF
+ exit 1
+fi
+
if [[ "${USERNAME}" != "nixos" ]]; then
echo "ERROR! ${0:t} should be run as the nixos user from a NixOS installer." >&2
exit 1