Sure because it would presumably ignore date
in the latter case. However, I think it has a false air of purity which is a bit concerning. Where plain fetchGit { url = "…"; }
would give you clearly different results at different times, with date
specified it would be impure only seldomly (i.e. force pushes or other weird situations), so it’s status would not be very intuitive.
Furthermore I’m not sure where it “fits” in Nix so to speak. We should generally encourage using rev
as it is actually content-addressed. The date
features seems oddly specific to me, i.e. I think it doesn’t have many legitimate uses beyond the one you are proposing which I’m not sure is such a killer feature. Also the same effect could be achieved by a mere shell script wrapper around nix-build
.
If it doesn’t “fit”, it should probably just be a Nix plugin (a feature we seem to have after all…).