nh icon indicating copy to clipboard operation
nh copied to clipboard

DOCS: document Nix Build Passthrough flags

Open ProducerMatt opened this issue 2 months ago • 2 comments

I wasn't aware until recently that nix build flags were accepted, as added in this PR: https://github.com/nix-community/nh/pull/311

It would be nice to have them mentioned in the man page, at least as a quick list of accepted flags so they show up in a grep.

If you'd like me to add them to the docs by hand, I'd be happy to. But I assumed the "correct" way to do this is making the list from the struct programmatically, and I'm not familiar enough with Rust to know how.

ProducerMatt avatar Oct 01 '25 01:10 ProducerMatt

I'll add those to the README and the manpages when U have some free time.

A PR would be welcome if you'd like to take a look, the manpages are created in xtask/src//man.rs using clap-mangen. Should be easy to modify

NotAShelf avatar Oct 02 '25 07:10 NotAShelf

Hi @NotAShelf! I just took a look at adding it. It seems like the right place to include the pass through args would be when turning these doc comments into messages: https://github.com/nix-community/nh/blob/c2159253e3139c2734369393b98a33a894ceedbb/src/interface.rs#L636

But I'm not sure what's the right way to do that. Two ideas:

  1. I could add a plaintext token like #passthroughargs to the comment that would get interpolated into a list of passthrough args
  2. I could add a special case in man.rs that detects if the argument is extra-args and if so, appends the list to the description.

Let me know if I'm on the right track, I'm leaning towards option 1.

By the way, I just looked at your profile and was blown away by all your contributions, you're a beast 💪

ProducerMatt avatar Oct 07 '25 22:10 ProducerMatt