NixOS for class room PCs using PXE?

Hi,
I don’t really know where to ask, if this is the wrong place please tell me.

We’re using LinuxMuster in one class room to boot the PCs, which basically boots from the network, downloads the OS image to a “cache” partition, then copies it to the actual root partition. I’ve always thought this was too complicated and takes a long time to boot.

I’ve never used NixOS (just installed it in a VM to play around).
My vision is something like this: All PCs have NixOS installed, boot into a PXE environment, grabs the configuration.nix from an FTP server and then boots NixOS. From my understanding, this should result in the same configuration on every PC on every boot.

Assuming I know only the basics, could someone point me in the right direction where I could find a guide/tool that can do this, or if nothing exists, what I should look into? I’m open to learning.

Also, does the idea even make sense?

I appreciate any input.

Thanks,
Jakob

I did something similar to this here. And someone wrote up another potentially related trick using nix-copy-closure here.

You could fairly easily build everything into the PXE image potentially like I’m doing . But nix-copy-closure might more easily let you copy whatever you want locally also. Any other deployment strategies would be relevant too here (e.g. deploy-rs or nixos-anywhere). Once you’re into a PXE image you control fully obviously, you can do pretty much whatever obviously.

1 Like

To set up NixOS to begin with, including ironing over an existing Linux, this the relevant tutorial:

Since you’re new to NixOS, I recommend starting with the basics first:

You’ll also be interested in integration testing before deploying, and setting up distributed builds.

Automatically pulling or pushing configurations as described by @nipsy sounds like the right way to go after that.