about summary refs log tree commit diff
path: root/modules/common/documentation.nix
blob: 33e767c7ea4ad9abb2ec86a41ce4d4188f542fcb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{
  config,
  lib,
  pkgs,
  this,
  ...
}:
with lib;
{
  config = {
    hm.manual = {
      manpages.enable = this.isHeadful;
      html.enable = false;
      json.enable = false;
    };

    documentation = {
      enable = this.isHeadful;
      dev.enable = true;
      doc.enable = false;
      info.enable = false;
      nixos.enable = true;

      man.man-db.manualPages =
        (pkgs.buildEnv {
          name = "man-paths";
          paths = with config; environment.systemPackages ++ hm.home.packages;
          pathsToLink = [ "/share/man" ];
          extraOutputsToInstall = [ "man" ];
          ignoreCollisions = true;
        }).overrideAttrs
          (_: _: { __contentAddressed = true; });
    };

    environment.variables = {
      MANOPT = "--no-hyphenation";
      MANPAGER = "${getExe pkgs.less} -+F";
    };
  };
}

Consider giving Nix/NixOS a try! <3