diff --git a/usb-nixos-installer/README.md b/usb-nixos-installer/README.md deleted file mode 100644 index 86d444c5c7..0000000000 --- a/usb-nixos-installer/README.md +++ /dev/null @@ -1,95 +0,0 @@ -# usb-nixos-installer - -**Scope: ONLY the USB bootstrap portion.** - -This directory contains exactly the four things needed to produce a -bootable NixOS USB installer that can install the target operating -system on a new machine over USB or Ethernet: - -1. **NixOS declarative configuration** — `nixos/installer/configuration.nix` -2. **NixFlakes for packages** — `flake.nix` at the directory root -3. **Git for version text storage** — every file here lives in git; - `flake.nix` references inputs by Git branch. **Run - `nix flake update` and commit the resulting `flake.lock`** to - pin to specific revisions for fully-reproducible builds. The - lock file isn't committed yet (no maintainer with Nix has run - `nix flake update` on this branch yet); first maintainer to - build the ISO should commit it. -4. **The OS Flake on a USB stick** — `nix build .#installer-iso` - produces a bootable ISO image you `dd` to a USB stick. The same - ISO supports Ethernet install (boot the target on the stick, - then `nixos-install --flake #` over the network). - -**This directory is intentionally minimal.** It does NOT contain -K3S, ArgoCD, Orleans, GitLab, observability, GPU runtime, or any -cluster workload. Those live in the `full-ai-cluster/` directory -at the repo root. - -For the full end-to-end AI cluster (including this USB bootstrap -as its starting snippet), see -. - -## Build the USB stick - -From any machine with Nix installed: - -```bash -cd usb-nixos-installer -nix build .#installer-iso -# Output: result/iso/zeta-installer-*.iso (~1.5-2 GB) -``` - -## Write the ISO to a USB stick - -### macOS - -```bash -diskutil list # find the USB device (e.g. /dev/disk4) -diskutil unmountDisk /dev/disk4 # replace 4 with your USB device number -sudo dd if=result/iso/zeta-installer-*.iso of=/dev/rdisk4 bs=4m status=progress -diskutil eject /dev/disk4 -``` - -### Linux - -```bash -lsblk # find the USB device (e.g. /dev/sdb) -sudo dd if=result/iso/zeta-installer-*.iso of=/dev/sdb bs=4M status=progress conv=fsync -sync -``` - -## Install on a target machine - -1. Boot the target on the USB stick. -2. Log in at the console as `root` (no password — upstream NixOS - installer default; console-only). -3. Bring up the network with `nmtui` (interactive) or - `nmcli device wifi connect password `. -4. Identify the target disk with `lsblk`. -5. Partition + mount as desired (parted/gptfdisk/cryptsetup/zfs - are all on the stick). -6. Generate per-machine hardware config: - `nixos-generate-config --root /mnt` -7. Install: - `nixos-install --flake #` where `` is one - of the names declared in `flake.nix` `nixosConfigurations`. - (This minimal installer only declares `installer` itself — - target-machine hosts live in `../full-ai-cluster/flake.nix`.) -8. Reboot. - -## What's on the stick - -The complete package list lives in -[`nixos/installer/configuration.nix`](nixos/installer/configuration.nix) -under `environment.systemPackages`. Categories include: - -- Version control: git, git-lfs, gnupg, openssh -- Editors: vim, neovim, nano -- Shell QoL: tmux, htop, ripgrep, jq, yq-go, fzf, bat -- Network: curl, wget, nmap, networkmanager, iwd, wireguard-tools -- Disk: parted, gptfdisk, cryptsetup, zfs, lvm2, mdadm -- Hardware inspection: lshw, dmidecode, nvme-cli, lm_sensors -- NixOS install tooling: nixos-install-tools, nix-output-monitor - -The flake itself is the tick source. Every subsequent install -reconciles toward the desired state declared here. diff --git a/usb-nixos-installer/flake.nix b/usb-nixos-installer/flake.nix deleted file mode 100644 index 715791f2a9..0000000000 --- a/usb-nixos-installer/flake.nix +++ /dev/null @@ -1,50 +0,0 @@ -# usb-nixos-installer/flake.nix -# -# USB-only flake. Produces a bootable NixOS installer ISO. -# Builds on Linux x86_64 natively; on Apple Silicon Macs use the -# nix-darwin linux-builder pattern (see the cluster flake at -# https://github.com/Lucent-Financial-Group/Zeta/tree/main/full-ai-cluster). - -{ - description = "Zeta USB installer — NixOS bootable image for AI-cluster bootstrap"; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { self, nixpkgs, flake-utils, ... }@inputs: - let - stateVersion = "24.11"; - in - { - nixosConfigurations.installer = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs stateVersion; }; - modules = [ - ./nixos/installer/configuration.nix - ]; - }; - } // flake-utils.lib.eachSystem [ "x86_64-linux" ] (system: - let - pkgs = import nixpkgs { inherit system; }; - in - { - packages = { - installer-iso = - self.nixosConfigurations.installer.config.system.build.isoImage; - default = self.packages.${system}.installer-iso; - }; - - devShells.default = pkgs.mkShell { - name = "zeta-usb-installer"; - packages = with pkgs; [ - git - nix-output-monitor - nh - ]; - }; - - formatter = pkgs.nixpkgs-fmt; - }); -} diff --git a/usb-nixos-installer/nixos/installer/configuration.nix b/usb-nixos-installer/nixos/installer/configuration.nix deleted file mode 100644 index 8181c9fd5a..0000000000 --- a/usb-nixos-installer/nixos/installer/configuration.nix +++ /dev/null @@ -1,204 +0,0 @@ -# usb-nixos-installer/nixos/installer/configuration.nix -# -# Single-file declarative installer image. Contains ONLY what's -# needed to boot a target machine and run `nixos-install --flake` -# against a host config from this repo. - -{ config, pkgs, lib, modulesPath, ... }: - -{ - imports = [ - "${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix" - "${modulesPath}/installer/cd-dvd/channel.nix" - ]; - - networking.hostName = "zeta-installer"; - time.timeZone = "America/New_York"; - i18n.defaultLocale = "en_US.UTF-8"; - - nix.settings = { - experimental-features = [ "nix-command" "flakes" ]; - auto-optimise-store = true; - trusted-users = [ "root" "nixos" ]; - substituters = [ - "https://cache.nixos.org" - "https://nix-community.cachix.org" - ]; - trusted-public-keys = [ - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - ]; - }; - - networking.networkmanager.enable = true; - networking.wireless.enable = lib.mkForce false; - networking.firewall.enable = true; - - # SSH off by default; console-only install. Enable manually for - # headless install with `sudo passwd nixos; sudo systemctl start sshd`. - services.openssh = { - enable = lib.mkForce false; - settings = { - PermitRootLogin = lib.mkForce "prohibit-password"; - PasswordAuthentication = lib.mkForce false; - KbdInteractiveAuthentication = lib.mkForce false; - }; - }; - - users.users.nixos = { - isNormalUser = true; - extraGroups = [ "wheel" "networkmanager" ]; - }; - - environment.systemPackages = with pkgs; [ - # Version control: pull the cluster flake onto the target - git - git-lfs - gnupg - openssh - - # Editors - vim - neovim - nano - - # Shell quality of life - bash - zsh - tmux - screen - htop - btop - tree - ripgrep - fd - fzf - bat - eza - jq - yq-go - less - file - which - unzip - zip - p7zip - rsync - - # Network - curl - wget - iproute2 - iputils - inetutils - dnsutils - nmap - tcpdump - mtr - ethtool - bind - networkmanager - iwd - wpa_supplicant - openvpn - wireguard-tools - - # Disk / partitioning / filesystems - parted - gptfdisk - util-linux - cryptsetup - dosfstools - e2fsprogs - xfsprogs - btrfs-progs - zfs - lvm2 - mdadm - smartmontools - - # Hardware inspection - pciutils - usbutils - lshw - dmidecode - hwinfo - inxi - lm_sensors - nvme-cli - hdparm - - # GPU detection (drivers come in per-host on installed system) - glxinfo - vulkan-tools - clinfo - - # NixOS install tooling - nixos-install-tools - nix-output-monitor - nvd - nh - - # Secrets management - age - sops - ssh-to-age - - # Build helpers - coreutils - findutils - gawk - gnused - gnugrep - diffutils - patch - gcc - gnumake - pkg-config - - # Observability of the install itself - iotop - iftop - ncdu - pv - progress - - # Documentation on the stick - man-pages - man-pages-posix - tldr - ]; - - isoImage = { - isoName = lib.mkForce "zeta-installer-${config.system.nixos.release}.iso"; - volumeID = lib.mkForce "ZETA_INSTALL"; - makeEfiBootable = true; - makeUsbBootable = true; - }; - - environment.etc."zeta-install.md".text = '' - Zeta USB installer - ================== - - 1. Boot this USB on the target machine. - 2. Log in at the console as `root` (no password — upstream - installer default; only usable from the local TTY). - 3. Bring up the network: - nmtui # interactive, or - nmcli device wifi connect password - 4. Identify the target disk: - lsblk - 5. Partition + mount /mnt as desired. - 6. Generate hardware config: - nixos-generate-config --root /mnt - 7. Clone the full cluster flake (or this minimal USB flake): - git clone /mnt/etc/zeta - 8. Install: - nixos-install --flake /mnt/etc/zeta/full-ai-cluster# - or for USB-only: - nixos-install --flake /mnt/etc/zeta/usb-nixos-installer#installer - 9. Reboot. - ''; - - system.stateVersion = "24.11"; -}