[1]: Or key? My C++ knowledge is almost nonexistent…
static RegisterPrimOp primop_fetchGit({
.name = "fetchGit",
.args = {"args"},
.doc = R"(
Fetch a path from git. *args* can be a URL, in which case the HEAD
of the repo at that URL is fetched. Otherwise, it can be an
attribute with the following attributes (all except `url` optional):
After building the cloned Nix repo with nix-build (following the instructions in 9.1 Hacking), I couldn’t find the manual in the build result. Was it in one of the man pages and I just missed it?
Am probably missing something basic, but can’t put 2 and 2 together:
As far as I can tell, any build command will result in evaluating flake.nix which should build the manual (unless I misinterpreted commands - which is highly likely)
Listing .gitignore references a doc/manual/src/expressions/builtins.md, but it is not there after nix-build
The doc/manual has a makefile (local.mk) that refers to builtins.md (here) and I can see a bunch of Nix expressions, but couldn’t figure out how to use them yet…
I built from the tag to leverage the cache, as it is a multi-output derivation, building the manual also requires building nix
toraritte:
Thank you! Will give it a try as soon as I can. As for the args nix/2.10.2\#nix^doc - where can I read about this syntax? 2.10.2 is the git tag, but the rest is a bit of a mystery.
Note to self: I asked the wrong question in the title instead of what I needed; that is,
How to build the Nix manual that reflects the local changes to the clone NixOS/nix repo?
NobbZ’s answers were spot on on both counts,
Nix version 2.9 or higher:nix build nix/2.10.2\#nix^doc Nix versions prior 2.9:nix build nix/2.10.2#nix.doc
but these would build the manual at the commit tagged with 2.10.2 and would thus ignore my local git branch and any changes that have been made. I’m still struggling to understand the flakeRef schemes, but simply using the following worked:
Note that the search will only include files indexed by git. In particular, files which are matched by .gitignore or have never been git add-ed will not be available in the flake. If this is undesirable, specify path:<directory> explicitly;
It feels like I actulally need path:<directory>, but wasn’t able to decipher how to use it yet.
I did some changes to part of the Nix source that gets pulled into the Nix manual, and none of them showed up after compilation, but once I committed them, they did. Although, as the the quoted section says, git add may be enough. (Will give it a try today, but building the Nix source takes ~30 mins on my laptop so…)