Files
Nomarchy/hosts/installer-iso.nix
Bernardo Magri a7e7fa9562 feat: keymap/locale + form factor in installer; nm-applet visible by default
- Installer prompts for keyboard layout (with optional variant) and locale
  via curated short list + Other… fallback into the full localectl list;
  applies to the live session immediately (loadkeys + hyprctl) so the
  rest of the install types correctly. Generated system.nix emits
  console.keyMap, i18n.defaultLocale, and services.xserver.xkb.{layout,
  variant}.
- New nomarchy.{system,}.formFactor enum (laptop|desktop, default laptop).
  Installer auto-detects via /sys/class/power_supply/BAT* and lets the
  user flip the answer. Waybar drops the battery widget on desktop;
  battery-monitor service is gated on the same option.
- Lift waybar tray out of the collapsed group/tray-expander in the default
  theme so nm-applet's icon is visible without expanding the drawer.
- Live ISOs (TTY + graphical) get baseline mkDefault keyMap/locale so the
  installer's runtime override always wins.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 20:26:55 +01:00

113 lines
3.5 KiB
Nix

{ config, pkgs, inputs, lib, ... }:
# Minimal TTY Installer ISO Configuration
#
# This creates a minimal, text-only installation environment.
# No desktop environment - just TTY with gum-based installer.
{
imports = [
../core/system/nix.nix
];
# Base installation media configuration is handled by the module imported in flake.nix
# Console configuration for a pleasant TTY experience.
# keyMap and i18n.defaultLocale are mkDefault — the install.sh keymap step
# calls `loadkeys` at runtime to honor the user's pick during the install,
# and writes the chosen value into the *installed* system's system.nix.
console = {
font = "ter-v16n";
packages = [ pkgs.terminus_font ];
keyMap = lib.mkDefault "us";
};
i18n.defaultLocale = lib.mkDefault "en_US.UTF-8";
# Essential packages for installation
environment.systemPackages = with pkgs; [
# Core utilities
git
vim
curl
wget
# TUI installer dependencies
gum
# Disk tools
inputs.disko.packages.${pkgs.stdenv.hostPlatform.system}.disko
parted
btrfs-progs
cryptsetup
# Network tools
networkmanager
# System info
lshw
pciutils
usbutils
# Installer command
(pkgs.writeShellScriptBin "nomarchy-install" ''
exec /etc/install.sh "$@"
'')
];
# Enable NetworkManager for easy network setup
networking.networkmanager.enable = true;
# Auto-login to TTY as root for installation
services.getty.autologinUser = lib.mkForce "root";
# Display welcome message and installer info
environment.etc."motd".text = ''
NOMARCHY INSTALLER
Run 'nomarchy-install' to start the installation wizard
For network setup: nmtui
For manual install: see /etc/nomarchy/
'';
# Make the installer script available
environment.etc."install.sh" = {
source = ../installer/install.sh;
mode = "0755";
};
# Symlink for easy access (merged into systemPackages above)
# The nomarchy-install script is created by writeShellScriptBin in the main list
# Include disko configurations
environment.etc."disko-golden.nix".source = ../installer/disko-golden.nix;
# Include Nomarchy source for installation
environment.etc."nomarchy".source = inputs.self;
# Disable graphical stuff - this is TTY only
services.xserver.enable = false;
services.displayManager.sddm.enable = lib.mkForce false;
# Ensure we have a proper shell environment
programs.bash.completion.enable = true;
# Auto-launch installer on the main TTY (tty1)
programs.bash.loginShellInit = ''
if [ "$(tty)" = "/dev/tty1" ]; then
nomarchy-install
fi
'';
# Include documentation
documentation.enable = true;
documentation.man.enable = true;
}