This kind of impurity is disgusting, worse than a fixed-output derivation. I don't think we should be allowing something like this in nixpkgs. If you want to control the version of the software you are distributing to users, please provide an upstream flake for others to use instead.