Since a couple of days I noticed that the “running activation script” startup stage takes more and more times. Today it took 5 minutes at least, which is huge. It also happens when I switch configuration via nixos-rebuild switch. I don’t know why that’s happening. I don’t know how to fix this, I don’t even know how to start to investigate, and I don’t really want to restart my computer since it seems to be getting worst…
Does it also occur when you nixos-rebuild switch to the same configuration?
Is it because a systemd service startup time? You could investigate with systemd-analyze or systemctl list-units during the switch.
While doing a nixos-rebuild switch, there is one thing that takes a lot of time and CPU (100% of one core): It’s Perl running some script named update-users-groups with some json file (which I suppose describes my users/groups configuration). I think that’s the problem.
Turns out this Perl script starts by decoding what should be a JSON file named /var/lib/nixos/uid-map. For unknown reason, on my computer, this file seems to just contain more than 3GB of pure garbage. How did that happened? I don’t know but this quest is starting to be fun.