Stream: nixos

Topic: Automate NixOS install on bare metal - howto?


view this post on Zulip Andreas (May 21 2024 at 08:17):

What is the easiest way to automate a NixOS install on bare metal? I had this question coming from someone, and I didn't quite know how to answer it.

Make a custom boot image I guess?

Partition disks with disko I guess?

But after that, is there a straightforward way to set up the boot image in such a way to pull in a (private) github nixosConfiguration from a flake to do all this stuff on first boot automatically?

view this post on Zulip Shivaraj B H (May 21 2024 at 16:31):

I would say this: https://nixos.asia/en/nixos-install-oneclick, once the tutorial is complete.

view this post on Zulip Andreas (May 21 2024 at 16:32):

ah awesome @Shivaraj B H I will check it out.

But I do not want to enter any commands on the machine I am installing NixOS on.

view this post on Zulip Shivaraj B H (May 21 2024 at 16:36):

Then it would be nixos-anywhere. Assuming you have wired ethernet and ssh access, it should work.

view this post on Zulip Andreas (May 21 2024 at 16:38):

yeah so the idea is then this?

1) Make a custom boot iso for NixOS with ssh access and ssh keys and stuff
2) Boot machine from that ISO
3) Use nixos-anywhere remotely to do disk configuration and proper installation

view this post on Zulip Shivaraj B H (May 21 2024 at 16:41):

You wouldn’t need NixOS in Step 1, it could be any Linux distro

view this post on Zulip Andreas (May 21 2024 at 16:42):

Yeah okay, technically that is true, but assuming I don't wanna mess with that and have a fundamentalist-purist approach :smile:

Also we are talking bare-metal install here, so I have physical access to the machine, I can put a USB drive in with whatever I have.

view this post on Zulip Andreas (May 21 2024 at 16:42):

The important point is also: I don't want to install any other Linux distro first. I just want to boot a live ISO.

view this post on Zulip Andreas (May 21 2024 at 16:43):

Can I use nixos-anywhere with, let's say, an Arch Linux Live USB boot?

view this post on Zulip Srid (May 21 2024 at 16:44):

Yes

view this post on Zulip Shivaraj B H (May 21 2024 at 16:44):

Can I use nixos-anywhere with, let's say, an Arch Linux Live USB boot?

Yes

The important point is also: I don't want to install any other Linux distro first. I just want to boot a live ISO.

In this case, I would still say https://nixos.asia/en/nixos-install-oneclick is most reliable approach


Last updated: Nov 15 2024 at 12:33 UTC