- Add installer/fresh-install.sh for installing from live ISO - Handles disk partitioning, LUKS encryption, filesystem setup - Generates minimal NixOS config for first boot - Enable flakes in ISO environment - Pass installer script content to ISO build via specialArgs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
111 lines
2.9 KiB
Nix
111 lines
2.9 KiB
Nix
# ISO Installer Configuration
|
|
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
modulesPath,
|
|
inputs,
|
|
installerScriptContent,
|
|
...
|
|
}: {
|
|
imports = [
|
|
"${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix"
|
|
"${modulesPath}/installer/cd-dvd/channel.nix"
|
|
];
|
|
|
|
# ISO naming
|
|
isoImage.isoName = "nomarchy-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.iso";
|
|
isoImage.volumeID = "NOMARCHY";
|
|
|
|
# Boot settings - use LTS kernel for ISO stability
|
|
boot.kernelPackages = pkgs.linuxPackages;
|
|
|
|
# Disable ZFS (broken with latest kernels)
|
|
boot.supportedFilesystems = lib.mkForce ["btrfs" "reiserfs" "vfat" "f2fs" "xfs" "ntfs" "cifs" "ext4"];
|
|
|
|
# Limine bootloader for ISO (commented out until properly configured)
|
|
# boot.loader.limine.enable = true;
|
|
|
|
# Enable SSH for headless installs
|
|
services.openssh = {
|
|
enable = true;
|
|
settings.PermitRootLogin = "yes";
|
|
};
|
|
|
|
# Networking
|
|
networking = {
|
|
hostName = "nomarchy-installer";
|
|
networkmanager.enable = true;
|
|
wireless.enable = lib.mkForce false;
|
|
};
|
|
|
|
# Installer environment packages
|
|
environment.systemPackages = with pkgs; [
|
|
# Disk partitioning
|
|
parted
|
|
gptfdisk
|
|
dosfstools
|
|
cryptsetup
|
|
|
|
# Filesystem tools
|
|
e2fsprogs
|
|
btrfs-progs
|
|
ntfs3g
|
|
|
|
# Network
|
|
networkmanager
|
|
wpa_supplicant
|
|
|
|
# TUI
|
|
dialog
|
|
newt # provides whiptail
|
|
|
|
# Utilities
|
|
vim
|
|
git
|
|
curl
|
|
wget
|
|
jq
|
|
|
|
# NixOS installation
|
|
nixos-install-tools
|
|
|
|
# Nomarchy installer script
|
|
(writeShellScriptBin "nomarchy-install" installerScriptContent)
|
|
];
|
|
|
|
# Auto-login to installer
|
|
services.getty.autologinUser = "nixos";
|
|
|
|
# Welcome message
|
|
environment.etc."motd".text = ''
|
|
|
|
╔═══════════════════════════════════════════════════════════╗
|
|
║ ║
|
|
║ Welcome to the Nomarchy Installer ║
|
|
║ ║
|
|
║ Run 'sudo nomarchy-install' to begin installation ║
|
|
║ ║
|
|
║ For more information: https://github.com/blu/nomarchy ║
|
|
║ ║
|
|
╚═══════════════════════════════════════════════════════════╝
|
|
|
|
'';
|
|
|
|
# User account
|
|
users.users.nixos = {
|
|
isNormalUser = true;
|
|
extraGroups = ["wheel" "networkmanager"];
|
|
initialPassword = "nomarchy";
|
|
};
|
|
|
|
# Allow passwordless sudo
|
|
security.sudo.wheelNeedsPassword = false;
|
|
|
|
# Enable flakes
|
|
nix.settings.experimental-features = ["nix-command" "flakes"];
|
|
|
|
# System state version
|
|
system.stateVersion = "24.11";
|
|
}
|