-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
sourceInfo does not tell us whether it's git or not #6747
Description
Is your feature request related to a problem? Please describe.
We'd like to set the configuration revision in NixOS to "dirty" when the repo is dirty, but we have to infer from sourceInfo?submodules whether it's git or not.
Describe the solution you'd like
An explicit identification of what type the source is. Perhaps not in the type or _type attr, because those can not represent subtyping hierarchies. A git sourceInfo is a sourceInfo, so tagging it only as type = "git" makes checking for sourceInfo hard.
A marker like isGit = true would be a better design, except I wouldn't want a isGit = false on all non-git sourceInfos. Perhaps an encoding like sourceInfo.git = { rev, ... } with all the git-related attrs inside would be best?
Describe alternatives you've considered
Hope that the submodules attribute remains an accurate signifier of git-ness.
Additional context