From 8e188e6b559d937f5ed7ddf4a8c4da69fa9e1535 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sun, 2 Jan 2022 23:57:01 +0100 Subject: machines/sternenseemann: mandoc module was upstreamed * Delete patched mandoc derivation and documentation.mandoc module from the tree, both have an equivalent upstream now. * Activate upstreamed documentation.man.mandoc module in my machines. --- machines/sternenseemann/base.nix | 16 +-- modules/module-list.nix | 1 - .../user/sternenseemann/documentation/mandoc.nix | 130 --------------------- pkgs/sternenseemann/default.nix | 9 -- 4 files changed, 9 insertions(+), 147 deletions(-) delete mode 100644 modules/user/sternenseemann/documentation/mandoc.nix diff --git a/machines/sternenseemann/base.nix b/machines/sternenseemann/base.nix index 499302f4..c6091175 100644 --- a/machines/sternenseemann/base.nix +++ b/machines/sternenseemann/base.nix @@ -59,13 +59,15 @@ in { documentation = { enable = true; dev.enable = true; - man.enable = false; - }; - - vuizvui.user.sternenseemann.documentation.mandoc = { - enable = true; - generateCaches = true; - manPath = [ "share/man" "share/man/de" ]; + man = { + enable = true; + generateCaches = true; + man-db.enable = false; + mandoc = { + enable = true; + manPath = [ "share/man" "share/man/de" ]; + }; + }; }; # HACK: create man0p, man1p, man3p etc. as directories in the environment diff --git a/modules/module-list.nix b/modules/module-list.nix index 5da9de76..3c1d5adc 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -41,7 +41,6 @@ ./user/profpatsch/services/bitlbee.nix ./user/profpatsch/services/gonic.nix ./user/profpatsch/services/dunst.nix - ./user/sternenseemann/documentation/mandoc.nix ./user/sternenseemann/services/sway.nix ./user/sternenseemann/programs/saneterm.nix ] diff --git a/modules/user/sternenseemann/documentation/mandoc.nix b/modules/user/sternenseemann/documentation/mandoc.nix deleted file mode 100644 index 594a653b..00000000 --- a/modules/user/sternenseemann/documentation/mandoc.nix +++ /dev/null @@ -1,130 +0,0 @@ -/* - - This module is the result of a more serious endeavour into - using mandoc as a complete replacement for man-db. Using - mandoc for viewing manual pages already kind of works by - just adding mandoc to environment.systemPackages — which - results in a lot of ugly environment clashes. - - man-db and mandoc only partially implement the same interface, - so it's not just a matter of switching out the used package - in documentation.man. However, a separate module is entirely - possible and even simpler than the one for man-db. - - However with generating the mandoc.db for apropos(1), - whatis(1) and -k of man(1), we hit a bump in the road: - makewhatis(8) does some sanity checking of the indexed - man pages which also includes checking that the realpath(3) - of any given man page is below the indexed directory. - This means that all man pages which are located in /nix/store - (i. e. all of them) will get skipped. - - This behavior is easily patched and there is also a similar - feature intended for homebrew which could be (ab)used. While - I try to get this particular fix/feature into upstream mandoc, - the patched package and the experimental module reside in - vuizvui. When everything is sorted, I'll (hopefully) be able - to contribute this module to nixpkgs upstream as well. - - Therefore this is also a user module in vuizvui despite its - non-me-specific nature — I hope this will only be temporary! - I do promise to fix your system configurations should you - use this particular module, though. - -*/ -{ config, lib, pkgs, ... }: - -let - - inherit (pkgs.vuizvui.sternenseemann) - mandoc - ; - - inherit (pkgs.vuizvui.profpatsch) - getBins - ; - - bins = getBins mandoc [ "makewhatis" ]; - - cfg = config.vuizvui.user.sternenseemann.documentation.mandoc; - docCfg = config.documentation; - -in { - options = { - vuizvui.user.sternenseemann.documentation.mandoc = { - enable = lib.mkOption { - type = lib.types.bool; - default = false; - description = '' - Whether to install the man utilities from - mandoc as well as manual - pages for installed packages from their - man outputs. - This can be used as a drop-in replacement - for documentation.man - with a few smaller differences. - ''; - }; - - manPath = lib.mkOption { - type = with lib.types; listOf str; - default = [ "share/man" ]; - example = lib.literalExample "[ \"share/man\" \"share/man/fr\" ]"; - description = '' - Change the manpath, i. e. the directories where man looks - for section-specific directories of man pages. - You only need to change this setting if you want non-english - man pages or a combination of different languages. All values - must be strings that are a valid path from the target prefix - (without including it). The first value given takes priority. - ''; - }; - - generateCaches = lib.mkOption { - type = lib.types.bool; - default = false; - description = '' - Whether to generate a mandoc.db indexing - the installed man pages for apropos(1), - whatis(1) and the -k - option of man(1) using - makewhatis(8). - ''; - }; - }; - }; - - config = lib.mkIf cfg.enable { - - assertions = [ - { - assertion = !(cfg.enable && docCfg.man.enable); - message = '' - vuizvui.user.sternenseemann.documentation.mandoc is a - replacement for documentation.man meaning they can't be - enabled at the same time. - ''; - } - ]; - - environment = { - # globally install man pages - pathsToLink = [ "/share/man" ]; - extraOutputsToInstall = [ "man" ] - ++ lib.optional docCfg.dev.enable "devman"; - # tell mandoc about man pages - systemPackages = [ mandoc ]; - etc."man.conf".text = lib.concatMapStrings - (path: "manpath /run/current-system/sw/${path}\n") - cfg.manPath; - # create mandoc.db for whatis(1), apropos(1) and man(1) -k - # TODO(sterni): remove -p for production™ - extraSetup = lib.optionalString cfg.generateCaches '' - ${bins.makewhatis} -p -T utf8 \ - ${lib.concatMapStringsSep " " - (path: "\"$out/${path}\"") - cfg.manPath} - ''; - }; - }; -} diff --git a/pkgs/sternenseemann/default.nix b/pkgs/sternenseemann/default.nix index e0f39e13..20ec9724 100644 --- a/pkgs/sternenseemann/default.nix +++ b/pkgs/sternenseemann/default.nix @@ -93,15 +93,6 @@ lib.fix (self: { inherit (profpatsch) getBins; }; - # patched packages - mandoc = pkgs.mandoc.overrideAttrs (old: rec { - # fix makewhatis(1) skipping all man pages that - # are symlinks to /nix/store - preConfigure = old.preConfigure + '' - echo READ_ALLOWED_PATH=\"${builtins.storeDir}\" >> configure.local - ''; - }); - pass = (pkgs.pass.override { waylandSupport = true; x11Support = false; -- cgit 1.4.1