Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/mandoc: init; nixos/documentation: refactor #139333

Merged
merged 7 commits into from
Dec 31, 2021

Conversation

sternenseemann
Copy link
Member

@sternenseemann sternenseemann commented Sep 24, 2021

Motivation for this change

TODO:

  • Update Release notes
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Sep 24, 2021
@ofborg ofborg bot requested a review from bb010g September 24, 2021 16:07
@sternenseemann sternenseemann changed the base branch from master to staging September 24, 2021 16:54
@sternenseemann sternenseemann mentioned this pull request Sep 24, 2021
12 tasks
@sternenseemann sternenseemann force-pushed the mandoc-module branch 4 times, most recently from d8e88e3 to 103e4c8 Compare September 24, 2021 19:16
@sternenseemann sternenseemann changed the title WIP: nixos/mandoc: init nixos/mandoc: init Sep 24, 2021
@sternenseemann sternenseemann marked this pull request as ready for review September 24, 2021 19:18
@sternenseemann sternenseemann changed the title nixos/mandoc: init nixos/mandoc: init; nixos/documentation: refactor Sep 24, 2021
@sternenseemann
Copy link
Member Author

@ofborg test man

nixos/modules/misc/man-db.nix Outdated Show resolved Hide resolved
nixos/modules/misc/man-db.nix Outdated Show resolved Hide resolved
nixos/modules/misc/mandoc.nix Outdated Show resolved Hide resolved
@ofborg ofborg bot requested a review from bb010g October 2, 2021 13:46
@sternenseemann sternenseemann changed the base branch from staging to master November 4, 2021 19:42
@sternenseemann sternenseemann force-pushed the mandoc-module branch 2 times, most recently from b300e7b to 9b97e43 Compare November 5, 2021 10:09
@sternenseemann sternenseemann changed the base branch from master to staging November 5, 2021 10:12
nixos/modules/misc/mandoc.nix Outdated Show resolved Hide resolved
@sternenseemann sternenseemann removed the request for review from infinisil November 22, 2021 22:00
@ofborg ofborg bot added 2.status: merge conflict This PR has merge conflicts with the target branch 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin and removed 2.status: merge conflict This PR has merge conflicts with the target branch 10.rebuild-darwin: 501+ 10.rebuild-darwin: 1001-2500 labels Nov 22, 2021
@github-actions github-actions bot added 8.has: changelog 8.has: documentation This PR adds or changes documentation labels Nov 22, 2021
@sternenseemann
Copy link
Member Author

@ofborg test man

nixos/doc/manual/from_md/release-notes/rl-2205.section.xml Outdated Show resolved Hide resolved
nixos/doc/manual/release-notes/rl-2205.section.md Outdated Show resolved Hide resolved
nixos/modules/misc/documentation.nix Show resolved Hide resolved
nixos/modules/misc/mandoc.nix Show resolved Hide resolved
It may be possible to revert the move of `documentation.man.manualPages`
later. The problem is that other man implementations (mandoc) want to
generate their index databases in place, so the approach taken here
doesn't translate super well.
man -k is useful to mention as it is -- in constrast to apropos(1) --
actually required by POSIX.
Adds a NixOS module which allows using mandoc as the main manual
viewer. It can be used as a drop-in replacement for documentation.man
which relies on GNU's man-db and provides more or less the same
features.

The generateCaches option requires a different implementation for
mandoc, so it is hard to share code between the two modules -- hence it
has been implemented separately. Using both at the same time makes
little sense and wouldn't quite work, so there's an assertion to
prevent it.

To make makewhatis(8) index manual pages which are symlinks to the nix
store, we need to set READ_ALLOWED_PATH to include
`builtins.storeDir`. For background and discussion see:
https://inbox.vuxu.org/mandoc-tech/c9932669-e9d4-1454-8708-7c8e36967e8e@systemli.org/T/
@sternenseemann sternenseemann merged commit 7106994 into NixOS:master Dec 31, 2021
@sternenseemann sternenseemann deleted the mandoc-module branch December 31, 2021 10:17
@ncfavier
Copy link
Member

ncfavier commented Jan 2, 2022

mandoc.manPath should probably accept absolute paths too, for man pages outside of /run/current-system/sw.

@sternenseemann
Copy link
Member Author

sternenseemann commented Jan 2, 2022 via email

@vcunat
Copy link
Member

vcunat commented May 16, 2022

A quick note in case you're interested: for me, switching configuration.nix to mandoc broke access to $HOME/.nix-profile/** pages.

@sternenseemann
Copy link
Member Author

That is indeed an oversight, I'll open an issue for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants