Jump to content

Apropos: Difference between revisions

From NixOS Wiki
imported>Ncfavier
Restore instructions for generating the cache manually
m syntaxhighlight fix
Line 2: Line 2:


To generate it manually (and again to update it when new software is installed), run:
To generate it manually (and again to update it when new software is installed), run:
<syntaxhighlight lang=bash>
<syntaxhighlight lang="console">
sudo mkdir -p /var/cache/man/nixos
$ sudo mkdir -p /var/cache/man/nixos
sudo mandb
$ sudo mandb
</syntaxhighlight>
</syntaxhighlight>


To enable automatically building the immutable cache, you can set:
To enable automatically building the immutable cache, you can set:
<syntaxhighlight lang=nix>
<syntaxhighlight lang="nix">
documentation.man.generateCaches = true;
{
  documentation.man.generateCaches = true;
}
</syntaxhighlight>
</syntaxhighlight>
Note that this will rebuild the cache every time you change anything in <code>environment.systemPackages</code>, and will make the <code>mandb</code> command fail.
Note that this will rebuild the cache every time you change anything in <code>environment.systemPackages</code>, and will make the <code>mandb</code> command fail.

Revision as of 16:49, 17 April 2025

By default as of NixOS 21.05, apropos, whatis and man -k do not find anything when run, because the man page index cache is not generated.

To generate it manually (and again to update it when new software is installed), run:

$ sudo mkdir -p /var/cache/man/nixos
$ sudo mandb

To enable automatically building the immutable cache, you can set:

{
  documentation.man.generateCaches = true;
}

Note that this will rebuild the cache every time you change anything in environment.systemPackages, and will make the mandb command fail.