this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: describe how it will roughly work

More like README driven development.

Khue Doan f1be94da 02a7fbc1

+71 -3
+71 -3
README.md
··· 5 5 [Pixiecore](https://github.com/danderson/netboot/tree/main/pixiecore) and 6 6 [nixos-anywhere](https://nix-community.github.io/nixos-anywhere). 7 7 8 + Currently, only `x86_64-linux` is supported. 9 + 8 10 ## Usage 9 11 12 + Example command to boot a custom NixOS installer and install the corresponding 13 + NixOS configuration from [`./examples/flake.nix`](./examples/flake.nix) on 14 + multiple bare-metal machines based on the MAC addresses defined in 15 + [`./examples/hosts.json`](./examples/hosts.json). 16 + 10 17 ```sh 11 - nixie \ 18 + sudo nixie \ 19 + --installer ./examples#nixosConfigurations.installer \ 12 20 --flake ./examples \ 13 - --installer ./examples#installer \ 14 - --hosts ./examples/hosts.json 21 + --hosts ./examples/hosts.json \ 22 + --ssh-key ~/.ssh/id_ed25519 23 + ``` 24 + 25 + TODO add a demo video/asciinema. 26 + 27 + Please see the full example in [`./examples`](./examples). 28 + 29 + ## How it works 30 + 31 + TODO refine the diagram after implementation. 32 + 33 + ```mermaid 34 + sequenceDiagram 35 + participant Nix 36 + participant Nixie 37 + participant Machines@{ "type" : "collections" } 38 + 39 + Nixie->>Nixie: Load hosts.json 40 + 41 + loop For each machine 42 + Nixie->>Machines: Try checking status 43 + end 44 + 45 + Nixie->>Nixie: Filter already installed hosts 46 + Nixie->>Nix: Build installer components<br/>(kernel, initrd, squashfs) 47 + Nixie->>Nixie: Start server components in goroutines<br/>(DHCP/TFTP/HTTP/API) 48 + 49 + loop For each machine 50 + Nixie->>Machines: Broadcast Wake-on-LAN magic packet 51 + 52 + activate Machines 53 + 54 + Note over Machines: Power on and start PXE boot 55 + 56 + Machines->>Nixie: UEFI firmware broadcast DHCP request 57 + Nixie->>Machines: DHCP provide IP (via Proxy DHCP) and next server info 58 + Machines->>Nixie: Request kernel 59 + Nixie->>Machines: TFTP send kernel 60 + Machines->>Nixie: Request initrd 61 + Nixie->>Machines: TFTP send initrd 62 + 63 + Note over Machines: Boot into NixOS installer 64 + Note over Machines: SystemD starts nixie-agent service 65 + Machines->>Nixie: nixie-agent phone home to request install with MAC address 66 + Nixie->>Nixie: Find flake based on MAC address and get client IP from API request 67 + Nixie->>Nix: Build NixOS configuration 68 + Nixie->>Machines: nixos-anywhere format disks via SSH based on disko configuration 69 + Nixie->>Machines: nixos-anywhere install system closure via SSH 70 + Nixie->>Machines: nixos-anywhere trigger reboot 71 + 72 + Note over Machines: Reboot after installation completed 73 + 74 + Nixie->>Machines: nixos-anywhere confirms machine rebooted 75 + deactivate Machines 76 + 77 + activate Machines 78 + 79 + Nixie->>Machines: Check host status 80 + end 81 + 82 + Note over Nixie: Return when all machines are installed 15 83 ```