Yes and yes. The reasoning why is described above.
I will say that Iāve used the direct github one and Iāve never had temporal cache misses or downtime problems. I also make extensive use of that particular input style by changing it to check a specific revision or PR, so itās not necessarily always the right choice to switch it.
And you donāt care for the command-not-found database to the point that you forget it even exists, which yāknow, fair enough, definitely more of a newbie-friendly feature
@TLATER , do channel tarbal inputs subsume the utility of something like this too?!
As in, channel tarbals include an uptodate nix-index-database, so no need to remember to either rebuild the database locally or update from another external cache?
Thatās my understanding, though I have to admit I have not tested this. The tarballs should include the database (thatās where non-flake configs get it from), I donāt know if itās hooked up correctly by default if youāre using a flake though.
Itās also not nix-index, but the built-in command-not-found. I think nix-index has some side-grades, but AIUI most people using it just use it as a command-not-found replacement for flake-based setups.
I just switched over to the tarball based nixpkgs input for a flake after seeing this thread, just to see what the experience is like.
I can confirm that command-not-found seems not be wired up correctly (or even enabled) by default, but it is not terribly complex to wire it up as needed, I have done it here:
And one must wire it up to your shell ( this may be done by default for shells other than nushell, I have not checked.).
Thatās definitely useful if you only use cnf, and maybe you can even PR this to nixpkgs?
But as someone who uses nix-locate manually, I still find nix-index-database more useful. (I also find cnf to be a bit slow and inconvenient, so I wrote a wrapper around nix-locate to run arbitrary binaries.)
If nom can provide the information it does, nix itself should also be able to calculate the number of revisions.
for i in ${f[@]}; do jq '[.. | objects | paths | select(last == "revCount") | join(".")]' $i 2>/dev/null; done | grep -v '\[\]'
it depends on the use case, but you should probably pin the inputs. a lot of users mentioned third party tarballs/blobs, but semantic versioning tracks that, even if the revCount seems arbitrary.
Since you donāt have that, you canāt make that computation. Itās metadata, yes, but it doesnāt give you anything you donāt get from a commit hash because semver is meaningless in nixpkgs.
Iād say so, i gave it a quick stab but gave up when I noticed that the nixpkgs input url is no longer exposed stringly in the module system, so youād have to make nontrivial changes to figure out if the tarball is used.
Just had a look myself, I had a vague recollection that some similar logic is used in nix.nixPath , but apparently it was decided to be too challenging to find the nixpkgs input url there too.
As @TLATER said, it seems this is not trivially possible.