nixos-up icon indicating copy to clipboard operation
nixos-up copied to clipboard

Options for dual boot?

Open izzues opened this issue 4 years ago • 3 comments

Hey,

I'd love to use your script to install and dual boot NixOS on a machine where Windows 10 is already installed (legacy BIOS). Is there a straightforward way to do it? By looking at the code I suppose not. If that's the case, I guess fully automatizing the process wouldn't be a trivial task either, but what about a simpler case? What if the script let you choose a partition or unallocated space and installed NixOS there instead of erasing the entire disk? Then the relevant options for OS autodiscovery could be automatically included in configuration.nix as per this guide.

Sorry if my suggestions are useless, I don't have experience with this.

Thanks for the great work!

izzues avatar Jun 25 '21 03:06 izzues

Mmm, yes this would definitely be nice to have. I haven't had to install nixos on a dual boot machine before, but it's probably much more common than the full disk install. I'll have to look into the details more.

Ultimately I'd like nixos-up to automate the process as much as possible. I think a flag specifying which partition to install on makes sense.

samuela avatar Jun 25 '21 18:06 samuela

Yes this would be very nice. @samuela are you planning on doing this anytime soon?

BentonEdmondson avatar Sep 25 '21 22:09 BentonEdmondson

I don't have a need for this atm, so it's not on my TODO list but I'd be happy to accept a PR. Here's what I think needs to happen:

  • Add a question at the very beginning of the install script asking whether the user would like to do a full-disk install or a multi-boot install.
  • If the user answers multi-boot, ask which disk, print all partitions for that disk, and then ask which partition is the boot partition (likely fat32). Then ask which partition to install NixOS onto.
  • Mount those two partitions at /mnt and /mnt/boot.
  • Proceed with the rest of the install as usual.

Shouldn't be too hard to do, but I don't have a convenient system to test this on atm.

samuela avatar Sep 25 '21 23:09 samuela