prism-installer
The master installation wizard for Prism OS. It orchestrates the entire installation process by chaining together specialized sub-scripts for partitioning and configuration generation. It provides a guided, terminal-based user interface (TUI) using gum to ensure a smooth installation experience.
How it works
- Initialization:
- Clears the screen and displays a stylized ASCII header.
- Creates a temporary state file (
/tmp/prism-install.env) to pass variables (like disk selection and hostname) between the different installation steps.
- Partitioning (
prism-installer-partition):- Launches the partitioning wizard (imported from
pkgs/installer/partition.nix). - This step handles disk selection and formatting.
- It saves critical variables like
BOOT_MODEandTARGET_DISKto the state file.
- Launches the partitioning wizard (imported from
- Configuration (
prism-installer-generate):- Loads the state from the partitioning step.
- Launches the configuration wizard (imported from
pkgs/installer/generate.nix). - This step generates the NixOS configuration, sets the hostname, and determines the Prism version tag (
LATEST_TAG).
- Installation:
- Displays a summary of the configuration (Target Hostname, Version).
- Confirmation: Asks the user to confirm before making permanent changes.
- Flake Locking: Generates a
flake.lockfile inside the target directory (/mnt/etc/prism) to ensure reproducible builds and prevent installation crashes. - System Install: Executes
nixos-install --flake ...to install the system to the mounted disk. It uses the--no-root-passwdflag, implying root password setup is handled elsewhere or viasudoconfiguration. - Post-Install: Fixes file ownership on the installed configuration files (
/etc/prism) to ensure the primary user (UID 1000) can edit them later.
- Completion: Offers to reboot the system immediately upon success.
Dependencies
gum: Provides the interactive TUI elements (spinners, confirm dialogs, styling).nix: Required for flake operations.nixos-install-tools: Provides the corenixos-installcommand.prism-installer-partition: (Sub-script) Handles disk partitioning.prism-installer-generate: (Sub-script) Handles config generation.
Usage
To start the installation from the live environment:
prism-installer