Hi I’ve been happily been using NixOS for my desktop for a year.
I’m trying to dual boot two instances of NixOS on a different machine but when I enter the bootloader only the most recently installed partition shows up. I used the graphical install, mistakenly used up the whole drive and encrypted it. Went to install it again, used GParted to clean up my mess and ended up with the untouched boot partition and the two different root partitions I want.
Nothing that I try gets both partitions to show up in the bootloader. systemd-boot wasn’t working so I changed my configuration.nix to include:
boot.loader = {
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = “/boot”; # I’ve also tried “/boot/EFI“
};
grub = {
default = “saved”; # not sure if this is required
device = “nodev”;
enable = true;
useOSProber = true;
efiSupport = true;
};
};
Notably I get this message when I rebuild:
modprobe: can’t change directory to ‘/lib/modules’: No such file or directory
But other than that it rebuilds without errors. I’m wondering if having two boot partitions would work. I’m guessing os-prober isn’t detecting the other partition. Notably both root partitions are encrypted. I’ve learned a fair bit through all my googling but alas come here with no solution.
I see from this that maybe I could get it to work with systemd-boot, but I am unsure what to put in extraEntries to point to the other partition. Need Advice on switching from systemd to grub on a dual boot on multiple disks - #3 by TLATER
I’d like one partition to be for work and the other for hobbies. I could pivot and make one of the partions a different Linux distro, use an external SSD for one, or just use a VM. I’m more than happy to share more info, but don’t know what is helpful and what is not.