also, nix-env has some odd behavior, and might not even be referencing your overlays, as I think it only references channels? (not actually sure, never use nix-env)
nixos-rebuild rebuilds everything, it just reuses existing build results if they exist. It ignores versions and only cares about .drv differences.
nix-env -u on the other hand doesn’t even know what the source derivation was for any given installed package, it only knows the name/version, so it looks for packages with the same name and a newer version (and has heuristics for dealing with multiple packages that share a name). It then installs just the packages it finds, and leaves everything els…