Moved the compatibility check from the deploy script to the deploy script to the start script. Moved install files and folders to /run/user for better security.
This commit is contained in:
@@ -74,34 +74,6 @@ cleanup() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
compatibility_check() {
|
|
||||||
TEST_FAIL=0
|
|
||||||
|
|
||||||
if [[ -r /etc/os-release ]] && grep -qi '^ID=nixos\b' /etc/os-release; then
|
|
||||||
echo -e "\n ✅ NixOS system detected."
|
|
||||||
else
|
|
||||||
TEST_FAIL=$((TEST_FAIL + 1))
|
|
||||||
echo -e "\n ❌ You are not on a NixOS based system. This is required to continue."
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$(uname -m)" == "x86_64" ]]; then
|
|
||||||
echo -e "\n ✅ x86_64 system detected."
|
|
||||||
else
|
|
||||||
TEST_FAIL=$((TEST_FAIL + 1))
|
|
||||||
echo -e "\n ❌ You are not on a x86_64 based system. This is required to continue."
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${TEST_FAIL} -gt 0 ]]; then
|
|
||||||
COMPATIBILITY_OVERRIDE=$(gum choose --header "Some compatibility checks failed. The installation will very likely fail. Continue ?" \
|
|
||||||
"No" \
|
|
||||||
"Yes, I know what I am doing")
|
|
||||||
[[ "${COMPATIBILITY_OVERRIDE}" == "No" ]] && exit 1
|
|
||||||
[[ "${COMPATIBILITY_OVERRIDE}" != "No" ]] && echo -e "\n ⚠️ Continuing anyways, this is not supported by Numbus."
|
|
||||||
fi
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
hierarchy_preparation() {
|
hierarchy_preparation() {
|
||||||
echod "\n 🔄 Preparing the folder hierarchy for the final configuration..."
|
echod "\n 🔄 Preparing the folder hierarchy for the final configuration..."
|
||||||
|
|
||||||
@@ -943,13 +915,6 @@ securely on a hidden sheet of paper or add it to your password manager (locally
|
|||||||
|
|
||||||
echo $LIVE_TARGET_PASSWORD | sudo -S passwd numbus-admin
|
echo $LIVE_TARGET_PASSWORD | sudo -S passwd numbus-admin
|
||||||
}
|
}
|
||||||
|
|
||||||
nix_update() {
|
|
||||||
echo -e "\n\n🔄 Updating NixOS on the remote server..."
|
|
||||||
|
|
||||||
nixos-rebuild --target-host numbus-admin@${LIVE_TARGET_IP} \
|
|
||||||
--use-remote-sudo switch --flake ${EXTRA_FILES_PATH}/etc/nixos#numbus-server
|
|
||||||
}
|
|
||||||
# --- MAIN FUNCTIONS ---<
|
# --- MAIN FUNCTIONS ---<
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ set -euo pipefail
|
|||||||
# This script clones the repository and launches the NixOS deployment script.
|
# This script clones the repository and launches the NixOS deployment script.
|
||||||
|
|
||||||
REPO_URL="https://gittea.dev/numbus/numbus.git"
|
REPO_URL="https://gittea.dev/numbus/numbus.git"
|
||||||
INSTALL_DIR="/tmp/numbus-installer"
|
INSTALL_DIR="/run/user/$(id -u)/numbus-installer"
|
||||||
|
|
||||||
echo "\n ☁️ Initializing Numbus Installer..."
|
echo "\n ☁️ Initializing Numbus Installer..."
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user