summary refs log tree commit diff
diff options
context:
space:
mode:
authorsternenseemann <sternenseemann@systemli.org>2021-10-02 15:28:48 +0200
committersterni <sternenseemann@systemli.org>2021-12-31 11:17:34 +0100
commitadfbfc0397887e668d8f91c45be013c044c53870 (patch)
treec5bde1f491ae80d522b41b989149f3f669ae5791
parent4942248a40e97272eff533f653b0aadc869d1252 (diff)
downloadnixpkgs-adfbfc0397887e668d8f91c45be013c044c53870.tar
nixpkgs-adfbfc0397887e668d8f91c45be013c044c53870.tar.gz
nixpkgs-adfbfc0397887e668d8f91c45be013c044c53870.tar.bz2
nixpkgs-adfbfc0397887e668d8f91c45be013c044c53870.tar.lz
nixpkgs-adfbfc0397887e668d8f91c45be013c044c53870.tar.xz
nixpkgs-adfbfc0397887e668d8f91c45be013c044c53870.tar.zst
nixpkgs-adfbfc0397887e668d8f91c45be013c044c53870.zip
nixos/mandoc: add package option
-rw-r--r--nixos/modules/misc/mandoc.nix14
1 files changed, 12 insertions, 2 deletions
diff --git a/nixos/modules/misc/mandoc.nix b/nixos/modules/misc/mandoc.nix
index 939f87a3178..3da60f2f8e6 100644
--- a/nixos/modules/misc/mandoc.nix
+++ b/nixos/modules/misc/mandoc.nix
@@ -1,7 +1,7 @@
 { config, lib, pkgs, ... }:
 
 let
-  makewhatis = "${lib.getBin pkgs.mandoc}/bin/makewhatis";
+  makewhatis = "${lib.getBin cfg.package}/bin/makewhatis";
 
   cfg = config.documentation.man.mandoc;
 
@@ -26,12 +26,22 @@ in {
           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 {
     environment = {
-      systemPackages = [ pkgs.mandoc ];
+      systemPackages = [ cfg.package ];
 
       # tell mandoc about man pages
       etc."man.conf".text = lib.concatMapStrings (path: ''