aboutsummaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to 'public')
-rwxr-xr-xpublic/install-nixos.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/public/install-nixos.sh b/public/install-nixos.sh
index f5bf321..b1eb126 100755
--- a/public/install-nixos.sh
+++ b/public/install-nixos.sh
@@ -63,8 +63,22 @@ wget -O "${TMP_DIR}/hardware-configuration.nix" "${SERVER}/hardware-configuratio
wget -O "${TMP_DIR}/template.nix" "${SERVER}/template.nix"
green "Done."
+yellow "Creating content of '/etc/nixos/local-configuration.nix'..."
export HOST_NAME
export DEVICE
-envsubst < "${TMP_DIR}/template.nix" > /etc/nixos/local-configuration.nix
+envsubst < "${TMP_DIR}/template.nix" > "${TMP_DIR}/local-configuration.nix"
+blue "$(cat "${TMP_DIR}/local-configuration.nix")"
+read -p "Confirm content of '/etc/nixos/local-configuration.nix'? (y/N) " -n 1 -r
+echo # Move to a new line
+if [[ ! $REPLY =~ ^[Yy]$ ]]; then
+ red "Unconfirmed content of '/etc/nixos/local-configuration.nix'."
+ red "Exitting."
+ exit 1
+fi
+green "Done."
+
+yellow "Moving presented content to '/etc/nixos/local-configuration.nix'..."
+echo mv "${TMP_DIR}/local-configuration.nix" /etc/nixos/local-configuration.nix
+green "Done."
# fdisk