updated common and install

This commit is contained in:
2026-03-29 09:12:30 -05:00
parent 30f5105cf4
commit 2986bba31b
3 changed files with 30 additions and 28 deletions

View File

@@ -17,10 +17,12 @@ in
services.gnome.gnome-initial-setup.enable = false; services.gnome.gnome-initial-setup.enable = false;
environment.gnome.excludePackages = with pkgs; [ gnome-tour gnome-user-docs ]; environment.gnome.excludePackages = with pkgs; [ gnome-tour gnome-user-docs ];
# Allow free user to run installer commands as root without a password
security.sudo.wheelNeedsPassword = false;
users.users.free = { users.users.free = {
isNormalUser = true; isNormalUser = true;
description = "free"; description = "free";
extraGroups = [ "networkmanager" ]; extraGroups = [ "networkmanager" "wheel" ];
initialPassword = "free"; initialPassword = "free";
}; };

View File

@@ -17,7 +17,7 @@ human_size() {
# ── 1. WELCOME & ROLE SELECTION ────────────────────────────────────────── # ── 1. WELCOME & ROLE SELECTION ──────────────────────────────────────────
ROLE=$(zenity --list --radiolist \ ROLE=$(zenity --list --radiolist \
--window-icon="$LOGO" \ --icon="$LOGO" \
--width=1000 --height=400 \ --width=1000 --height=400 \
--title="Welcome to Sovran SystemsOS" \ --title="Welcome to Sovran SystemsOS" \
--text="<span font='36' weight='heavy'>Sovran Systems</span>\n<span font='16' style='italic' foreground='#aaaaaa'>Be Digitally Sovereign</span>\n\nPlease select your preferred installation type:" \ --text="<span font='36' weight='heavy'>Sovran Systems</span>\n<span font='16' style='italic' foreground='#aaaaaa'>Be Digitally Sovereign</span>\n\nPlease select your preferred installation type:" \
@@ -28,7 +28,7 @@ ROLE=$(zenity --list --radiolist \
FALSE "₿" "Node (Bitcoin-only)" "Full Bitcoin node with Bitcoin Lightning and non-KYC buying and selling." || true) FALSE "₿" "Node (Bitcoin-only)" "Full Bitcoin node with Bitcoin Lightning and non-KYC buying and selling." || true)
if [ -z "$ROLE" ]; then if [ -z "$ROLE" ]; then
zenity --error --window-icon="$LOGO" --text="Installation cancelled." zenity --error --icon="$LOGO" --text="Installation cancelled."
exit 1 exit 1
fi fi
@@ -38,7 +38,7 @@ fi
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,RO,TRAN -e 7,11 | awk '$3=="disk" && $4=="0" && $5!="usb" {print $1":"$2}')
if [ "${#DISKS[@]}" -eq 0 ]; then if [ "${#DISKS[@]}" -eq 0 ]; then
zenity --error --window-icon="$LOGO" --text="No valid internal drives found. (USB drives are ignored)" zenity --error --icon="$LOGO" --text="No valid internal drives found. (USB drives are ignored)"
exit 1 exit 1
fi fi
@@ -58,7 +58,7 @@ fi
# Updated to check against 2TB # Updated to check against 2TB
if [ -n "$DATA_DISK" ] && [ "$DATA_SIZE" -lt "$BYTES_2TB" ]; then 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." zenity --warning --icon="$LOGO" --text="Second disk detected (${DATA_DISK}), but it is smaller than 2TB.\n\nIt will NOT be used."
DATA_DISK="" DATA_DISK=""
DATA_SIZE="" DATA_SIZE=""
fi fi
@@ -70,9 +70,9 @@ else
SUMMARY="${SUMMARY}\nData disk: none" SUMMARY="${SUMMARY}\nData disk: none"
fi fi
CONFIRM=$(zenity --entry --window-icon="$LOGO" --text="WARNING: This will ERASE ALL DATA on:\n\n${SUMMARY}\n\nType ERASE to continue.") CONFIRM=$(zenity --entry --icon="$LOGO" --text="WARNING: This will ERASE ALL DATA on:\n\n${SUMMARY}\n\nType ERASE to continue.")
if [ "$CONFIRM" != "ERASE" ]; then if [ "$CONFIRM" != "ERASE" ]; then
zenity --error --window-icon="$LOGO" --text="Install cancelled." zenity --error --icon="$LOGO" --text="Install cancelled."
exit 1 exit 1
fi fi
@@ -88,27 +88,27 @@ fi
# Use --arg (not --argstr) so device paths are passed as Nix string values correctly # Use --arg (not --argstr) so device paths are passed as Nix string values correctly
( (
if [ -n "$DATA_PATH" ]; then if [ -n "$DATA_PATH" ]; then
disko --mode disko /etc/sovran/flake/iso/disko.nix \ sudo disko --mode disko /etc/sovran/flake/iso/disko.nix \
--arg device '"'"$BOOT_PATH"'"' \ --arg device '"'"$BOOT_PATH"'"' \
--arg dataDevice '"'"$DATA_PATH"'"' --arg dataDevice '"'"$DATA_PATH"'"'
else else
disko --mode disko /etc/sovran/flake/iso/disko.nix \ sudo disko --mode disko /etc/sovran/flake/iso/disko.nix \
--arg device '"'"$BOOT_PATH"'"' --arg device '"'"$BOOT_PATH"'"'
fi fi
) 2>&1 | zenity --progress --pulsing \ ) 2>&1 | zenity --progress --pulsing \
--window-icon="$LOGO" \ --icon="$LOGO" \
--title="Partitioning Drives" \ --title="Partitioning Drives" \
--text="Partitioning and formatting your drives...\n\nThis will take a moment." \ --text="Partitioning and formatting your drives...\n\nThis will take a moment." \
--width=500 \ --width=500 \
--auto-close \ --auto-close \
--no-cancel --no-cancel
nixos-generate-config --root /mnt sudo nixos-generate-config --root /mnt
cp /mnt/etc/nixos/hardware-configuration.nix /tmp/hardware-configuration.nix cp /mnt/etc/nixos/hardware-configuration.nix /tmp/hardware-configuration.nix
rm -rf /mnt/etc/nixos/* sudo rm -rf /mnt/etc/nixos/*
cp -a /etc/sovran/flake/* /mnt/etc/nixos/ sudo cp -a /etc/sovran/flake/* /mnt/etc/nixos/
cp /tmp/hardware-configuration.nix /mnt/etc/nixos/hardware-configuration.nix sudo cp /tmp/hardware-configuration.nix /mnt/etc/nixos/hardware-configuration.nix
# ── 4. APPLY ROLE STATE & TEMPLATE ─────────────────────────────────────── # ── 4. APPLY ROLE STATE & TEMPLATE ───────────────────────────────────────
@@ -122,7 +122,7 @@ case "$ROLE" in
"Node (Bitcoin-only)") IS_NODE="true" ;; "Node (Bitcoin-only)") IS_NODE="true" ;;
esac esac
cat > /mnt/etc/nixos/role-state.nix <<EOF sudo tee /mnt/etc/nixos/role-state.nix > /dev/null <<EOF
# THIS FILE IS AUTO-GENERATED BY THE INSTALLER. DO NOT EDIT. # THIS FILE IS AUTO-GENERATED BY THE INSTALLER. DO NOT EDIT.
# To change your role later, edit custom.nix instead. # To change your role later, edit custom.nix instead.
{ config, lib, ... }: { config, lib, ... }:
@@ -134,14 +134,14 @@ cat > /mnt/etc/nixos/role-state.nix <<EOF
EOF EOF
# Copy the pristine custom.template.nix for the user to edit # Copy the pristine custom.template.nix for the user to edit
cp /mnt/etc/nixos/custom.template.nix /mnt/etc/nixos/custom.nix sudo cp /mnt/etc/nixos/custom.template.nix /mnt/etc/nixos/custom.nix
# ── 5. VERIFY FILES BEFORE INSTALL ─────────────────────────────────────── # ── 5. VERIFY FILES BEFORE INSTALL ───────────────────────────────────────
# Sanity check: ensure role-state.nix and custom.nix exist before calling nixos-install # Sanity check: ensure role-state.nix and custom.nix exist before calling nixos-install
for f in /mnt/etc/nixos/role-state.nix /mnt/etc/nixos/custom.nix; do for f in /mnt/etc/nixos/role-state.nix /mnt/etc/nixos/custom.nix; do
if [ ! -f "$f" ]; then if [ ! -f "$f" ]; then
zenity --error --window-icon="$LOGO" --width=500 \ zenity --error --icon="$LOGO" --width=500 \
--title="Installation Error" \ --title="Installation Error" \
--text="<b>A required file is missing:</b>\n\n<tt>${f}</tt>\n\nThe installation cannot continue. Please check the log at <tt>${LOG}</tt> and try again." --text="<b>A required file is missing:</b>\n\n<tt>${f}</tt>\n\nThe installation cannot continue. Please check the log at <tt>${LOG}</tt> and try again."
exit 1 exit 1
@@ -150,9 +150,9 @@ done
# ── 6. FINAL INSTALL & REBOOT ──────────────────────────────────────────── # ── 6. FINAL INSTALL & REBOOT ────────────────────────────────────────────
nixos-install --root /mnt --flake /mnt/etc/nixos#nixos 2>&1 | \ sudo nixos-install --root /mnt --flake /mnt/etc/nixos#nixos 2>&1 | \
zenity --progress --pulsing \ zenity --progress --pulsing \
--window-icon="$LOGO" \ --icon="$LOGO" \
--title="Installing Sovran SystemsOS" \ --title="Installing Sovran SystemsOS" \
--text="Installing your system...\n\nThis may take 2040 minutes depending on your internet speed.\nPlease do not turn off your computer." \ --text="Installing your system...\n\nThis may take 2040 minutes depending on your internet speed.\nPlease do not turn off your computer." \
--width=500 \ --width=500 \
@@ -172,4 +172,4 @@ Before you reboot, please write down your main login details:
Click OK to reboot into your new system!" Click OK to reboot into your new system!"
reboot sudo reboot

2
result
View File

@@ -1 +1 @@
/nix/store/f8vzhhkqnyir5kjrksw39jbjcxkw0vrs-Sovran_SystemsOS.iso /nix/store/d2wsw3p539hmdhc6gaxjds8l2yw1jr4n-Sovran_SystemsOS.iso