about summary refs log tree commit diff
path: root/modules/nixos/common/documentation.nix
blob: f909108677da6928b625f9a516901ac99cded116 (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
{
  config,
  lib,
  pkgs,
  this,
  ...
}:
with lib; {
  config = mkIf this.isHeadful {
    documentation = {
      dev.enable = true;
      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.sessionVariables = {
      MANOPT = "--no-hyphenation";
      MANPAGER = "${pkgs.less}/bin/less -+F";
    };
  };
}

Consider giving Nix/NixOS a try! <3