Multiboot with systemd-boot

I’m looking to make a setup with NixOS, Alpine and LMDE, using systemd-boot in a separated partition. How I could set systemd-boot in NixOS configuration. If it doesn’t detect distros in other partitions, I need to define entries for they? I can put the entries in the NixOS config file?

Partition scheme:

/dev/sda1: EFI (Not entire /boot just bootloader)
/dev/sda2: Swap
/dev/sda3: NixOS
/dev/sda4: Alpine
/dev/sda5: LMDE (Linux Mint Debian Edition)

I don’t want to have a separated boot and home partition for each distro to no have so many.

What about this?


 boot = {

   loader = { 

     systemd-boot = {

        enable = true;

        extraEntries = {

          "Alpine.conf" = ''
           title Alpine Linux
           linux /vmlinuz-linux
           initrd /initramfs-linux.img
           options root=UUID=<ALPINE-UUID> rootfstype=ext4 rw add_efi_memmap
          '';

          "LMDE.conf" = ''
          title Linux Mint Debian (LMDE)
          linux /vmlinuz
          initrd /initrd.img
          options root=UUID=<LMDE-UUID> rootfstype=ext4 rw add_efi_memmap
         '';

     };

    efi = { 

      canTouchEfiVariables = true;
      efiSysMountPoint = "/boot/efi"; # To /dev/sda1 

    };

   };

 };

In hardware-configuration.nix:

 
 fileSystems."/boot/efi" = {

  device = "/dev/disk/by-uuid/XXXXXXXX";  # UUID of /dev/sda1
  fsType = "vfat";

};

Yes, that’s what extraEntries is for.