Package disppears after reboot

I’m using a neovim nightly overlay and I’ve gotten it to successfully install by adding the overlay and then including the package in my configuration.nix via environment.systemPackages. Once I run nixos-rebuild --switch the package is available. Once I reboot though however, the package is not installed. Am I doing this the wrong way?

To note, I’m using the Virtualbox VM in VMware Fusion, so maybe this might relate to the issue?

If you have a separate boot partition, is it mounted when you run nixos-rebuild? I’ve made the mistake of forgetting a fileSystems."/boot" config entry before and it causes behaviour like this. The switch succeeds but GRUB doesn’t get updated to point to the latest system configuration.

1 Like

That’s possible, that my configuration is incorrect. I’m somewhat unfamiliar with the filesystem setup of this virtualbox machine. Is there an easy way to determine if my machine is configured in that way? Or do I definitely need to have a boot config entry? I’ll see what I can determine.

Thanks for your help @khumba!

Hi there,

What you need depends on how you’ve set the system up to boot, whether with BIOS boot or EFI, and whether you’re using GRUB or systemd-boot or not. Are you able to post your system’s configuration.nix, and your partition layout (output of lsblk) please?

I’ve had something similar but admittedly didn’t do anything about getting the actual problem fixed, but just worked around it locally.

  1. systemd is supposed to detect the ESP and then set up boot.{mount|automount} units.
  2. sometimes it wouldn’t do that correctly and simply ignore the ESP
  3. when that happens and you run nixos-rebuild boot, it would install to the /boot directory on the root partition/volume rather than the ESP

So in this case you would end up restarting into an older generation.

My *fix" for this:

  1. unmount the ESP if it is mounted
  2. mv /boot /bootx
  3. mkdir /boot
  4. mount the ESP on /boot
  5. move everything from /bootx to /boot
  6. add this to configuration.nix:
   fileSystems = {
     "/boot" = {
       device = "/dev/disk/by-uuid/8355-E5B1";
       fsType = "vfat";
       options = [
         "x-systemd.automount"
       ];
     };
   };

Rebuild and you should be off to the races!