updated pdf creator and overall theme

This commit is contained in:
2026-03-29 00:33:21 -05:00
parent 76605b161d
commit d4ca1b54e5
9 changed files with 565 additions and 47 deletions

View File

@@ -6,17 +6,21 @@ exec > >(tee -a "$LOG") 2>&1
export PATH=/run/current-system/sw/bin:$PATH
BYTES_4TB=$((4 * 1024 * 1024 * 1024 * 1024))
# Changed to 2TB cutoff
BYTES_2TB=$((2 * 1024 * 1024 * 1024 * 1024))
LOGO="/etc/sovran/logo.png"
human_size() {
numfmt --to=iec --suffix=B "$1"
}
zenity --info --width=500 --text="Sovran SystemsOS Installer\n\nWARNING:\nThis installer will ERASE ALL DATA on selected disks.\n\nPress OK to continue."
zenity --info --window-icon="$LOGO" --text="Sovran SystemsOS Installer\n\nWARNING:\nThis installer will ERASE ALL DATA on selected disks.\n\nPress OK to continue."
# Filter out USB drives and loop/cdrom devices so it doesn't try to install to the installation media
mapfile -t DISKS < <(lsblk -b -dno NAME,SIZE,TYPE,RO,TRAN -e 7,11 | awk '$3=="disk" && $4=="0" && $5!="usb" {print $1":"$2}')
mapfile -t DISKS < <(lsblk -b -dno NAME,SIZE,TYPE | awk '$3=="disk"{print $1":"$2}')
if [ "${#DISKS[@]}" -eq 0 ]; then
zenity --error --text="No disks found."
zenity --error --window-icon="$LOGO" --text="No valid internal drives found. (USB drives are ignored)"
exit 1
fi
@@ -34,8 +38,9 @@ if [ "${#DISKS_SORTED[@]}" -ge 2 ]; then
DATA_SIZE="${DISKS_SORTED[-1]##*:}"
fi
if [ -n "$DATA_DISK" ] && [ "$DATA_SIZE" -lt "$BYTES_4TB" ]; then
zenity --warning --width=500 --text="Second disk detected (${DATA_DISK}), but it is smaller than 4TB.\n\nIt will NOT be used."
# Updated to check against 2TB
if [ -n "$DATA_DISK" ] && [ "$DATA_SIZE" -lt "$BYTES_2TB" ]; then
zenity --warning --window-icon="$LOGO" --text="Second disk detected (${DATA_DISK}), but it is smaller than 2TB.\n\nIt will NOT be used."
DATA_DISK=""
DATA_SIZE=""
fi
@@ -47,7 +52,8 @@ else
SUMMARY="${SUMMARY}\nData disk: none"
fi
ROLE=$(zenity --list --radiolist --width=500 --height=250 \
ROLE=$(zenity --list --radiolist \
--window-icon="$LOGO" \
--title="Choose Install Role" \
--column="" --column="Role" \
TRUE "Server-Desktop (default)" \
@@ -58,52 +64,21 @@ if [ -z "$ROLE" ]; then
ROLE="Server-Desktop (default)"
fi
CONFIRM=$(zenity --entry --width=500 --text="WARNING: This will ERASE ALL DATA on:\n\n${SUMMARY}\n\nType ERASE to continue.")
CONFIRM=$(zenity --entry --window-icon="$LOGO" --text="WARNING: This will ERASE ALL DATA on:\n\n${SUMMARY}\n\nType ERASE to continue.")
if [ "$CONFIRM" != "ERASE" ]; then
zenity --error --text="Install cancelled."
zenity --error --window-icon="$LOGO" --text="Install cancelled."
exit 1
fi
BOOT_PATH="/dev/${BOOT_DISK}"
PART_SUFFIX=""
if [[ "$BOOT_DISK" =~ ^(nvme|mmcblk) ]]; then
PART_SUFFIX="p"
fi
parted --script "$BOOT_PATH" mklabel gpt
parted --script "$BOOT_PATH" mkpart ESP fat32 1MiB 512MiB
parted --script "$BOOT_PATH" set 1 esp on
parted --script "$BOOT_PATH" mkpart primary ext4 512MiB 100%
partprobe "$BOOT_PATH"
udevadm settle
mkfs.fat -F 32 -n boot "${BOOT_PATH}${PART_SUFFIX}1"
mkfs.ext4 -F -L sovran_systemsos "${BOOT_PATH}${PART_SUFFIX}2"
DATA_PATH=""
if [ -n "$DATA_DISK" ]; then
DATA_PATH="/dev/${DATA_DISK}"
part_suffix_data=""
if [[ "$DATA_DISK" =~ ^(nvme|mmcblk) ]]; then
part_suffix_data="p"
fi
parted --script "$DATA_PATH" mklabel gpt
parted --script "$DATA_PATH" mkpart primary ext4 1MiB 100%
partprobe "$DATA_PATH"
udevadm settle
mkfs.ext4 -F -L BTCEcoandBackup "${DATA_PATH}${part_suffix_data}1"
fi
mkdir -p /mnt
mount /dev/disk/by-label/sovran_systemsos /mnt
mkdir -p /mnt/boot/efi
mount /dev/disk/by-label/boot /mnt/boot/efi
if [ -n "$DATA_DISK" ]; then
mkdir -p /mnt/run/media/Second_Drive
mount /dev/disk/by-label/BTCEcoandBackup /mnt/run/media/Second_Drive
fi
# Run Disko to partition and format drives
echo "Running Disko to partition and format drives..."
disko --mode disko /etc/sovran/flake/iso/disko.nix --argstr device "$BOOT_PATH" --argstr dataDevice "$DATA_PATH"
nixos-generate-config --root /mnt
@@ -123,5 +98,21 @@ EOF
nixos-install --root /mnt --flake /mnt/etc/nixos#nixos
zenity --info --text="Install complete. Rebooting..."
reboot
EOF
nixos-install --root /mnt --flake /mnt/etc/nixos#nixos
zenity --warning --width=600 --title="INSTALLATION COMPLETE! 🚨 PLEASE READ" --text="<b><span size='large'>Installation Successful!</span></b>
Before you reboot, please write down your main login details:
<b>Username:</b> free
<b>Password:</b> free
🚨 <b>CRITICAL:</b> Do not lose this password! If you forget this, you will be permanently locked out of your computer.
📁 <b>Other Passwords:</b> Once the system reboots, it will finish building your forts and generate all the passwords for your apps (Nextcloud, Bitcoin, Matrix, etc.). It will save them in a secure PDF in your <b>Documents</b> folder.
Click OK to reboot into your new system!"
reboot