Strictly speaking, question of "number of packages" for NixOS is somewhat nonsensical (there are no packages in NixOS, and this was pointed out in https://github.com/KittyKatt/screenFetch/pull/220).
However, I believe even then counting a number of derivations in a current system makes more sense than counting number of derivations resolving to directories ever installed.
Strictly speaking, question of "number of packages" for NixOS is somewhat nonsensical (there are no packages in NixOS, and this was pointed out in https://github.com/KittyKatt/screenFetch/pull/220).
However, I believe even then counting a number of derivations in a current system makes more sense than counting number of derivations resolving to directories ever installed.