nix.dev icon indicating copy to clipboard operation
nix.dev copied to clipboard

dynamically generate Nix manual version overview

Open fricklerhandwerk opened this issue 1 year ago • 2 comments

this removes more manuals steps from adapting the site to new releases.

@nixos/documentation-team please bikeshed whether to generate pages at all, as this introduces some mental overhead for working with the site.

depends on #830

fricklerhandwerk avatar Jan 15 '24 13:01 fricklerhandwerk

I looked at the changes and they seem ok, I don't know what you were referring to when you said "whether to generate pages at all" (what's the alternative? Not have any links to the nix manuals from nix.dev?).

However, I've been thinking. Is it possible to grab the nix version directly from each channel during CI? By that I mean, can we do a few "niv add " in CI and then for each channel, run nix --version and grab the version from there, so we (ideally) don't need to do any manual intervention at all?

DanielSidhion avatar Jan 17 '24 11:01 DanielSidhion

We could also link to stable uniformly, or even expand such links to the actual version at build time. The rabbit hole of content generation is as deep as any Turing tar pit.

fricklerhandwerk avatar Feb 12 '24 07:02 fricklerhandwerk

It works now and is even somewhat readable:

$ ls $(nix-build -A build --no-out-link)/manual/nix
2.10  2.11  2.12  2.13  2.14  2.15  2.16  2.17  2.18  2.19  2.20  2.21  2.4  2.5  2.6  2.7  2.8  2.9

Extra goodie: The Nix manual is again (optionally) available as single page (ping @ehmry)!

image

fricklerhandwerk avatar Apr 03 '24 12:04 fricklerhandwerk

I'm afraid the code felt very cobbled together overall.. I kind of refactored the entire code now :sweat_smile:. Please check the commit message for more details, but this PR looks good to me now. I tested it locally with netlify dev -d result, including the redirects. I'm also pretty sure that all Nix versions are cached now, I don't have to build any anymore.

Extra goodie: The Nix manual is again (optionally) available as single page (ping @ehmry)!

I reverted that for now, though I left it in the code: https://github.com/NixOS/nix.dev/blob/4daecbe3930134041d197e01509b52038692a8d2/default.nix#L54-L56

This feels way too hacky for me, it should be discussed a bit more. And there's no reason this has to be part of this PR, let's not make it bigger than it already is!

infinisil avatar Apr 04 '24 00:04 infinisil

@infinisil thanks a lot for the review pass, it's quite solid now. I'll open a new PR for single-page rendering.

fricklerhandwerk avatar Apr 05 '24 15:04 fricklerhandwerk

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/tweag-nix-dev-update-56/43035/1

nixos-discourse avatar Apr 09 '24 08:04 nixos-discourse