Systemd boot doesn't show old generations anymore

Today I had to reboot my machine, and I realized that it doesn’t offer earlier generations in the boot menu anymore.

This problem does exist in the tux-nixos In the config linked below:

may shed some light on it, however it may be unrelated as i’ve not updated to flakes yet…

are you sure that older generations are not getting garbage collected in some way, leading to older generations to be removed?

I update and rebuild daily, doing GC keeping 5d.

Also I just rebuilt and rebooted. No generations visible.

Also what I realized right now was, that back when it worked, the generation number, the nixos version and nixpkgs commit short ref have been part of the Menu entry, now it’s just “nixos”.

Will later do some more explicit tests to check if indeed the changes survive the reboot…

/boot is mounted though, I already checked this morning.

Okay, did some more testing.

Preboot:

$ nixos-version --json | jq
{
  "configurationRevision": "3faabb6aba9bc81225d554d247a659df68fff3dc",
  "nixosVersion": "20.09.20210213.2118cf5",
  "nixpkgsRevision": "2118cf551b9944cfdb929b8ea03556f097dd0381"
}
$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 931.5G  0 disk 
├─sda1   8:1    0     1G  0 part /boot
├─sda2   8:2    0     1G  0 part 
├─sda3   8:3    0     1G  0 part 
├─sda4   8:4    0    16G  0 part [SWAP]
└─sda5   8:5    0 912.5G  0 part 
sr0     11:0    1  1024M  0 rom  
$ sudo parted --list
Model: ATA Samsung SSD 860 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name       Flags
 1      1049kB  1075MB  1074MB  fat32           nix_boot   boot, esp
 2      1075MB  2149MB  1074MB  fat32           arch_boot  msftdata
 3      2149MB  3222MB  1074MB                  kept_free
 4      3222MB  20.4GB  17.2GB  linux-swap(v1)  swap       swap
 5      20.4GB  1000GB  980GB                   rpool

Postboot:

{
  "nixosVersion": "20.09.20201224.ca11974",
  "nixpkgsRevision": "ca119749d86f484066fae7680af8a44ea1f11ca8"
}

So the sole entry does boot into a two month old system configuration.

I will see later today what I have done during that time that used that commit of nixpkgs…

I checked my other machines, all of them have their last selectable system configuration from around Christmas.

Though both are using grub, therefore I haven’t seen the issue earlier, there I’m used to only see 2 entries.

Okay, the commits of my config around that change have been the last where I used nixos-rebuild switch --flake.

Then I introduced another way that would just use nix build and result/bin/switch-to-configuration switch.

It seems as if I did miss to “translate” some of the commands that nixos-rebuild runs.

Someone else here who just builds and runs the activation script? @Mic92, I think you mentioned doing it once?