mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/mandoc: add package option
This commit is contained in:
parent
4942248a40
commit
adfbfc0397
1 changed files with 12 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
makewhatis = "${lib.getBin pkgs.mandoc}/bin/makewhatis";
|
makewhatis = "${lib.getBin cfg.package}/bin/makewhatis";
|
||||||
|
|
||||||
cfg = config.documentation.man.mandoc;
|
cfg = config.documentation.man.mandoc;
|
||||||
|
|
||||||
|
@ -26,12 +26,22 @@ in {
|
||||||
The first value given takes priority.
|
The first value given takes priority.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
package = lib.mkOption {
|
||||||
|
type = lib.types.package;
|
||||||
|
default = pkgs.mandoc;
|
||||||
|
defaultText = lib.literalExpression "pkgs.mandoc";
|
||||||
|
description = ''
|
||||||
|
The <literal>mandoc</literal> derivation to use. Useful to override
|
||||||
|
configuration options used for the package.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
environment = {
|
environment = {
|
||||||
systemPackages = [ pkgs.mandoc ];
|
systemPackages = [ cfg.package ];
|
||||||
|
|
||||||
# tell mandoc about man pages
|
# tell mandoc about man pages
|
||||||
etc."man.conf".text = lib.concatMapStrings (path: ''
|
etc."man.conf".text = lib.concatMapStrings (path: ''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue