Commit 3fff19ce authored by Gaute Ravndal's avatar Gaute Ravndal
Browse files

nixos/documentation: rename man.generateCaches to man.cache.enable

parent a2172ad1
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -228,6 +228,10 @@ in
    (mkRenamedOptionModule [ "programs" "info" "enable" ] [ "documentation" "info" "enable" ])
    (mkRenamedOptionModule [ "programs" "man" "enable" ] [ "documentation" "man" "enable" ])
    (mkRenamedOptionModule [ "services" "nixosManual" "enable" ] [ "documentation" "nixos" "enable" ])
    (mkRenamedOptionModule
      [ "documentation" "man" "generateCaches" ]
      [ "documentation" "man" "cache" "enable" ]
    )
    (mkRemovedOptionModule [
      "documentation"
      "nixos"
@@ -261,7 +265,7 @@ in
        '';
      };

      man.generateCaches = mkOption {
      man.cache.enable = mkOption {
        type = types.bool;
        default = false;
        description = ''
+2 −2
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ in
        };
        defaultText = lib.literalMD "all man pages in {option}`config.environment.systemPackages`";
        description = ''
          The manual pages to generate caches for if {option}`documentation.man.generateCaches`
          The manual pages to generate caches for if {option}`documentation.man.cache.enable`
          is enabled. Must be a path to a directory with man pages under
          `/share/man`; see the source for an example.
          Advanced users can make this a content-addressed derivation to save a few rebuilds.
@@ -94,7 +94,7 @@ in
        MANPATH_MAP /run/current-system/sw/bin /run/current-system/sw/share/man
        MANPATH_MAP /run/wrappers/bin          /run/current-system/sw/share/man

        ${lib.optionalString config.documentation.man.generateCaches ''
        ${lib.optionalString config.documentation.man.cache.enable ''
          # Generated manual pages cache for NixOS (immutable)
          MANDB_MAP /run/current-system/sw/share/man ${manualCache}
        ''}
+2 −2
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ in
        apply = makeLeadingSlashes;
        description = ''
          Change the paths where mandoc {manpage}`makewhatis(8)`generates the
          manual page index caches. {option}`documentation.man.generateCaches`
          manual page index caches. {option}`documentation.man.cache.enable`
          should be enabled to allow cache generation. This list should only
          include the paths to manpages installed in the system configuration,
          i. e. /run/current-system/sw/share/man. {manpage}`makewhatis(8)`
@@ -215,7 +215,7 @@ in
      # create mandoc.db for whatis(1), apropos(1) and man(1) -k
      # TODO(@sternenseemman): fix symlinked directories not getting indexed,
      # see: https://inbox.vuxu.org/mandoc-tech/20210906171231.GF83680@athene.usta.de/T/#e85f773c1781e3fef85562b2794f9cad7b2909a3c
      extraSetup = lib.mkIf config.documentation.man.generateCaches ''
      extraSetup = lib.mkIf config.documentation.man.cache.enable ''
        for man_path in ${
          lib.concatMapStringsSep " " (path: "$out" + lib.escapeShellArg path) cfg.cachePath
        }
+1 −1
Original line number Diff line number Diff line
@@ -169,7 +169,7 @@ in
    programs.fish.shellAliases = lib.mapAttrs (name: lib.mkDefault) cfge.shellAliases;

    # Required for man completions
    documentation.man.generateCaches = lib.mkDefault true;
    documentation.man.cache.enable = lib.mkDefault true;

    environment = lib.mkMerge [
      (lib.mkIf cfg.useBabelfish {