Mutliple Nixos installations systemd-boot possible

I now have multiple nixos installations on the same machine (don’t ask why)

each installation now erases the others boot entries.

Problem 1: both installations are using the same id /efi/loader/entries/-stuff
Problem 2, both name their config /efi/loader/entries/nixos-generation-X.conf
Problem 3. they are deleting other stuff (but not other distribution stuff)

Is there a way to configure systemd-boot to use some kind of namespace for the entries / suff directories and then only cleanup entries/stuff with that namespace?

Not currently possible, but I’ve long wanted to add a feature like this to our systemd-boot module.

2 Likes

Sadge, are there some workarounds?

Chainloading other EFI partition?

Some mobo firmwares get confused by multiple ESPs, but you can try.

1 Like

systemd-boot doesn’t have syntax for booting an EFI executable from a different partition or drive (other than XBOOTDLDR). But we do have this horrible hack in our systemd-boot module for booting Windows from another drive using a horrible UEFI shell script thing.

1 Like

Specializations might be the best bet. Not technically another install, but you can get multiple “instances” from a rebuild and config. If you split the config high enough, and pass different everything like filesystems, then it really would mimic “separate” installs. I can’t speak to how robust this is though.

Is that what specialisation exactly doing? (I have never use it).

I solved it differently, gave ever installation its own efi partition and then have a a oneshot systemd service that just copies from one to another while renaming/ editing entries.

UEFI then only uses one partition but it wouldn’t really matter which one.

Edit: if MB can’t handle that, the additional partitions can also just be regular fat32 partitions as NixOS doesn’t care as long as it can write something to /boot

1 Like