nix-community / nixos-images

Automatically build (netboot) images for NixOS [maintainer=@Mic92]
MIT License
216 stars 41 forks source link

Netboot Image with preconfigured/random password #303

Open max06 opened 3 days ago

max06 commented 3 days ago

Good evening folks!

I'm currently preparing a pxe environment for semi-automated provisioning of many physical and virtual machines. These machines should be ready for their nixos-anywhere deployment after boot, without human interaction.

Your current installer images with their display of the generated root-password and network config is almost ideal. (It just doesn't work in my ipxe environment due to efi/memdisk.)

Could you add that functionality to the pxe images as well?

Moving this a step further: Would it be possible to specify a fixed root password (or public key) with the command line options?

Thanks a lot!

(I could probably generate my own modified images - I'm just too lazy to add another responsibility to that project. Keeping it simple and stupid.)

Mic92 commented 3 days ago

Did we not already support putting password hashes in the cmdline in nixos in general?

https://github.com/NixOS/nixpkgs/blob/76193bc2e99e42ddd6264bba9c5c372bc019e50e/nixos/modules/installer/cd-dvd/installation-cd-base.nix#L37

Unsure if we also import this in the netboot image, but if we don't, we can add this. Would you than still need a random password in that case?

max06 commented 3 days ago

This sounds awesome!

No, if I can specify a hash, I'm all set.

And thanks for the quick response 🙇🏼