Build-dates of older nixos gnerations were changed after executing nix-store --optimise

Hi,
the build-dates of my older nixos generations have changed and and I’m not sure if this is expected behaviour of nixos or if it’s a bug, but i found it somehow strange.
Before it happened, I deleted older genenerations with sudo nix-collect-garbage --delete-older-than 30d. Afterwards I ran nix-store --optimise as a non root user, and then sudo nixos-rebuild switch --upgrade.
During reboot, I noticed that the build-dates of all the older generations that weren’t deleted had changed. The build-dates of all the older generations are now all the same day and in the same time frame when the nix-store --optimise command was running.
sudo nixos-rebuild list-generations also shows the changed build-dates.
But sudo nix-env --list-generations --profile /nix/var/nix/profiles/system shows the original build-dates before they were changed.

Known bug

1 Like

Yes, that’s the same issue I encountered. Thanks for the link.