this repo has no description
0
fork

Configure Feed

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

refactor: split serve into api and pxe

Kinda unrelated really.

Khue Doan fa04c1d9 725bc0ff

+15 -13
+5 -4
README.md
··· 1 1 # Nixie 2 2 3 + **Open-source bare metal provisioning engine for NixOS.** 4 + 3 5 <img width="272" height="240" alt="image" src="https://github.com/user-attachments/assets/7621ef6f-3cf4-45df-bb1a-e19511f2d536" /> 4 6 5 - Open-source bare metal provisioning engine for NixOS. Nixie enables zero-touch 6 - deployment of NixOS to multiple machines over the network, turning blank hard 7 - drives into fully configured systems in minutes. 8 - 9 7 > [!WARNING] 10 8 > Basic [features](#features) are functional and you can try them out, but some 11 9 > parts are still missing and there are known issues. 10 + 11 + Nixie enables zero-touch deployment of NixOS to multiple machines over the 12 + network, turning blank hard drives into fully configured systems in minutes. 12 13 13 14 Nixie is a simpler, stateless alternative to [Foreman](https://theforeman.org), 14 15 [MAAS](https://canonical.com/maas), [OpenStack
+2 -2
cmd/nixie-agent/client.go
··· 10 10 "net/http" 11 11 "time" 12 12 13 - "code.khuedoan.com/nixie/internal/serve" 13 + "code.khuedoan.com/nixie/internal/api" 14 14 ) 15 15 16 16 func ping(address string) error { ··· 45 45 } 46 46 } 47 47 48 - func install(address string, installRequest serve.InstallRequest) error { 48 + func install(address string, installRequest api.InstallRequest) error { 49 49 client := &http.Client{Timeout: 5 * time.Second} 50 50 body, err := json.Marshal(&installRequest) 51 51 if err != nil {
+2 -2
cmd/nixie-agent/main.go
··· 3 3 import ( 4 4 "log" 5 5 6 - "code.khuedoan.com/nixie/internal/serve" 6 + "code.khuedoan.com/nixie/internal/api" 7 7 ) 8 8 9 9 func main() { ··· 18 18 } 19 19 log.Printf("successfully sent ping to API server") 20 20 21 - installRequest := serve.InstallRequest{ 21 + installRequest := api.InstallRequest{ 22 22 MACAddress: params.MACAddress, 23 23 } 24 24 if err = install(params.APIAddress, installRequest); err != nil {
+4 -3
cmd/nixie/main.go
··· 6 6 "os/signal" 7 7 "syscall" 8 8 9 + "code.khuedoan.com/nixie/internal/api" 9 10 "code.khuedoan.com/nixie/internal/hosts" 10 11 "code.khuedoan.com/nixie/internal/network" 11 12 "code.khuedoan.com/nixie/internal/nixos" 12 - "code.khuedoan.com/nixie/internal/serve" 13 + "code.khuedoan.com/nixie/internal/pxe" 13 14 14 15 "github.com/charmbracelet/log" 15 16 ) ··· 53 54 } 54 55 log.Debug("installer components", "kernel", installerComponents.Kernel, "initrd", installerComponents.Initrd, "init", installerComponents.Init) 55 56 56 - pxeServer, err := serve.NewPXEServer( 57 + pxeServer, err := pxe.NewPXEServer( 57 58 address, 58 59 installerComponents.Kernel, 59 60 installerComponents.Initrd, ··· 73 74 74 75 doneCh := make(chan struct{}, 1) 75 76 go func() { 76 - if err := serve.StartAPIServer(ctx, hostsConfig, flags.Flake, flags.Debug, doneCh); err != nil { 77 + if err := api.StartAPIServer(ctx, hostsConfig, flags.Flake, flags.Debug, doneCh); err != nil { 77 78 log.Fatal("failed to start API server", "error", err) 78 79 } 79 80 }()
internal/hosts/config.go internal/hosts/hosts.go
+1 -1
internal/serve/api.go internal/api/api.go
··· 1 - package serve 1 + package api 2 2 3 3 import ( 4 4 "context"
+1 -1
internal/serve/pxe.go internal/pxe/pixiecore.go
··· 1 - package serve 1 + package pxe 2 2 3 3 import ( 4 4 "bytes"