treewide: fix `rec-set-dynamic-attrs`
This is a backport of `#479126`.
Not-cherry-picked-because: there was more packages to fix then in 25.11 and master.
> Lix will soon warn, and in the future, error on `rec-set-dynamic-attrs`.
> This commit fix where attrs are dynamically set in a recursive function
> currently present in nixpkgs.