···56 cfg = config.documentation.man.mandoc;
78-in {
00000000000009 meta.maintainers = [ lib.maintainers.sternenseemann ];
1011 options = {
12 documentation.man.mandoc = {
13- enable = lib.mkEnableOption (lib.mdDoc "mandoc as the default man page viewer");
1415 manPath = lib.mkOption {
16 type = with lib.types; listOf str;
17 default = [ "share/man" ];
18 example = lib.literalExpression "[ \"share/man\" \"share/man/fr\" ]";
19- description = lib.mdDoc ''
20- Change the manpath, i. e. the directories where
21- {manpage}`man(1)`
22 looks for section-specific directories of man pages.
23 You only need to change this setting if you want extra man pages
24 (e. g. in non-english languages). All values must be strings that
25 are a valid path from the target prefix (without including it).
26- The first value given takes priority.
027 '';
28 };
29···31 type = lib.types.package;
32 default = pkgs.mandoc;
33 defaultText = lib.literalExpression "pkgs.mandoc";
34- description = lib.mdDoc ''
35 The `mandoc` derivation to use. Useful to override
36 configuration options used for the package.
37 '';
38 };
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000039 };
40 };
41···43 environment = {
44 systemPackages = [ cfg.package ];
4546- # tell mandoc about man pages
47- etc."man.conf".text = lib.concatMapStrings (path: ''
48- manpath /run/current-system/sw/${path}
49- '') cfg.manPath;
05051 # create mandoc.db for whatis(1), apropos(1) and man(1) -k
52 # TODO(@sternenseemman): fix symlinked directories not getting indexed,
53 # see: https://inbox.vuxu.org/mandoc-tech/20210906171231.GF83680@athene.usta.de/T/#e85f773c1781e3fef85562b2794f9cad7b2909a3c
54 extraSetup = lib.mkIf config.documentation.man.generateCaches ''
55- ${makewhatis} -T utf8 ${
56 lib.concatMapStringsSep " " (path:
57 "$out/" + lib.escapeShellArg path
58- ) cfg.manPath
59- }
000060 '';
00061 };
62 };
63}
···56 cfg = config.documentation.man.mandoc;
78+ toMandocOutput = output: (
9+ lib.mapAttrsToList
10+ (
11+ name: value:
12+ if lib.isString value || lib.isPath value then "output ${name} ${value}"
13+ else if lib.isInt value then "output ${name} ${builtins.toString value}"
14+ else if lib.isBool value then lib.optionalString value "output ${name}"
15+ else if value == null then ""
16+ else throw "Unrecognized value type ${builtins.typeOf value} of key ${name} in mandoc output settings"
17+ )
18+ output
19+ );
20+in
21+{
22 meta.maintainers = [ lib.maintainers.sternenseemann ];
2324 options = {
25 documentation.man.mandoc = {
26+ enable = lib.mkEnableOption "mandoc as the default man page viewer";
2728 manPath = lib.mkOption {
29 type = with lib.types; listOf str;
30 default = [ "share/man" ];
31 example = lib.literalExpression "[ \"share/man\" \"share/man/fr\" ]";
32+ description = ''
33+ Change the paths included in the MANPATH environment variable,
34+ i. e. the directories where {manpage}`man(1)`
35 looks for section-specific directories of man pages.
36 You only need to change this setting if you want extra man pages
37 (e. g. in non-english languages). All values must be strings that
38 are a valid path from the target prefix (without including it).
39+ The first value given takes priority. Note that this will not
40+ add manpath directives to {manpage}`man.conf(5)`.
41 '';
42 };
43···45 type = lib.types.package;
46 default = pkgs.mandoc;
47 defaultText = lib.literalExpression "pkgs.mandoc";
48+ description = ''
49 The `mandoc` derivation to use. Useful to override
50 configuration options used for the package.
51 '';
52 };
53+54+ settings = lib.mkOption {
55+ description = "Configuration for {manpage}`man.conf(5)`";
56+ default = { };
57+ type = lib.types.submodule {
58+ options = {
59+ manpath = lib.mkOption {
60+ type = with lib.types; listOf str;
61+ default = [ ];
62+ example = lib.literalExpression "[ \"/run/current-system/sw/share/man\" ]";
63+ description = ''
64+ Override the default search path for {manpage}`man(1)`,
65+ {manpage}`apropos(1)`, and {manpage}`makewhatis(8)`. It can be
66+ used multiple times to specify multiple paths, with the order
67+ determining the manual page search order.
68+ This is not recommended in favor of
69+ {option}`documentation.man.mandoc.manPath`, but if it's needed to
70+ specify the manpath in this way, set
71+ {option}`documentation.man.mandoc.manPath` to an empty list (`[]`).
72+ '';
73+ };
74+ output.fragment = lib.mkEnableOption ''
75+ Omit the <!DOCTYPE> declaration and the <html>, <head>, and <body>
76+ elements and only emit the subtree below the <body> element in HTML
77+ output of {manpage}`mandoc(1)`. The style argument will be ignored.
78+ This is useful when embedding manual content within existing documents.
79+ '';
80+ output.includes = lib.mkOption {
81+ type = with lib.types; nullOr str;
82+ default = null;
83+ example = lib.literalExpression "../src/%I.html";
84+ description = ''
85+ A string of relative path used as a template for the output path of
86+ linked header files (usually via the In macro) in HTML output.
87+ Instances of `%I` are replaced with the include filename. The
88+ default is not to present a hyperlink.
89+ '';
90+ };
91+ output.indent = lib.mkOption {
92+ type = with lib.types; nullOr int;
93+ default = null;
94+ description = ''
95+ Number of blank characters at the left margin for normal text,
96+ default of `5` for {manpage}`mdoc(7)` and `7` for
97+ {manpage}`man(7)`. Increasing this is not recommended; it may
98+ result in degraded formatting, for example overfull lines or ugly
99+ line breaks. When output is to a pager on a terminal that is less
100+ than 66 columns wide, the default is reduced to three columns.
101+ '';
102+ };
103+ output.man = lib.mkOption {
104+ type = with lib.types; nullOr str;
105+ default = null;
106+ example = lib.literalExpression "../html%S/%N.%S.html";
107+ description = ''
108+ A template for linked manuals (usually via the Xr macro) in HTML
109+ output. Instances of ‘%N’ and ‘%S’ are replaced with the linked
110+ manual's name and section, respectively. If no section is included,
111+ section 1 is assumed. The default is not to present a hyperlink.
112+ If two formats are given and a file %N.%S exists in the current
113+ directory, the first format is used; otherwise, the second format is used.
114+ '';
115+ };
116+ output.paper = lib.mkOption {
117+ type = with lib.types; nullOr str;
118+ default = null;
119+ description = ''
120+ This option is for generating PostScript and PDF output. The paper
121+ size name may be one of `a3`, `a4`, `a5`, `legal`, or `letter`.
122+ You may also manually specify dimensions as `NNxNN`, width by
123+ height in millimetres. If an unknown value is encountered, letter
124+ is used. Output pages default to letter sized and are rendered in
125+ the Times font family, 11-point. Margins are calculated as 1/9 the
126+ page length and width. Line-height is 1.4m.
127+ '';
128+ };
129+ output.style = lib.mkOption {
130+ type = with lib.types; nullOr path;
131+ default = null;
132+ description = ''
133+ Path to the file used for an external style-sheet. This must be a
134+ valid absolute or relative URI.
135+ '';
136+ };
137+ output.toc = lib.mkEnableOption ''
138+ In HTML output of {manpage}`mandoc(1)`, If an input file contains
139+ at least two non-standard sections, print a table of contents near
140+ the beginning of the output.
141+ '';
142+ output.width = lib.mkOption {
143+ type = with lib.types; nullOr int;
144+ default = null;
145+ description = ''
146+ The ASCII and UTF-8 output width, default is `78`. When output is a
147+ pager on a terminal that is less than 79 columns wide, the
148+ default is reduced to one less than the terminal width. In any case,
149+ lines that are output in literal mode are never wrapped and may
150+ exceed the output width.
151+ '';
152+ };
153+ };
154+ };
155+ };
156+157+ extraConfig = lib.mkOption {
158+ type = lib.types.lines;
159+ default = "";
160+ description = ''
161+ Extra configuration to write to {manpage}`man.conf(5)`.
162+ '';
163+ };
164 };
165 };
166···168 environment = {
169 systemPackages = [ cfg.package ];
170171+ etc."man.conf".text = lib.concatStringsSep "\n" (
172+ (map (path: "manpath ${path}") cfg.settings.manpath)
173+ ++ (toMandocOutput cfg.settings.output)
174+ ++ [ cfg.extraConfig ]
175+ );
176177 # create mandoc.db for whatis(1), apropos(1) and man(1) -k
178 # TODO(@sternenseemman): fix symlinked directories not getting indexed,
179 # see: https://inbox.vuxu.org/mandoc-tech/20210906171231.GF83680@athene.usta.de/T/#e85f773c1781e3fef85562b2794f9cad7b2909a3c
180 extraSetup = lib.mkIf config.documentation.man.generateCaches ''
181+ for man_path in ${
182 lib.concatMapStringsSep " " (path:
183 "$out/" + lib.escapeShellArg path
184+ ) cfg.manPath} ${lib.concatMapStringsSep " " (path:
185+ lib.escapeShellArg path) cfg.settings.manpath
186+ }
187+ do
188+ [[ -d "$man_path" ]] && ${makewhatis} -T utf8 $man_path
189+ done
190 '';
191+192+ # tell mandoc the paths containing man pages
193+ profileRelativeSessionVariables."MANPATH" = map (path: if builtins.substring 0 1 path != "/" then "/${path}" else path) cfg.manPath;
194 };
195 };
196}
-2
nixos/modules/security/sudo-rs.nix
···67 cfg = config.security.sudo-rs;
89- inherit (config.security.pam) enableSSHAgentAuth;
10-11 toUserString = user: if (isInt user) then "#${toString user}" else "${user}";
12 toGroupString = group: if (isInt group) then "%#${toString group}" else "%${group}";
13
···67 cfg = config.security.sudo-rs;
8009 toUserString = user: if (isInt user) then "#${toString user}" else "${user}";
10 toGroupString = group: if (isInt group) then "%#${toString group}" else "%${group}";
11
···23buildNpmPackage rec {
4 pname = "asf-ui";
5- version = "c582499d60f0726b6ec7f0fd27bd533c1f67b937";
67 src = fetchFromGitHub {
8 owner = "JustArchiNET";
···10 # updated by the update script
11 # this is always the commit that should be used with asf-ui from the latest asf version
12 rev = version;
13- hash = "sha256-dTSYlswMWWRafieWqNDIi3qCBvNAkcmZWKhQgJiv2Ts=";
14 };
1516- npmDepsHash = "sha256-0zzP1z3VO9Y4gBWJ+T7oHhKE/H2dzMUMg71BKupVcH4=";
1718 installPhase = ''
19 runHook preInstall
···23buildNpmPackage rec {
4 pname = "asf-ui";
5+ version = "f84a296f0ab029e56baba3cca45e5cf21129fd76";
67 src = fetchFromGitHub {
8 owner = "JustArchiNET";
···10 # updated by the update script
11 # this is always the commit that should be used with asf-ui from the latest asf version
12 rev = version;
13+ hash = "sha256-NISUhxClFAzLQp4o9AzMzasPV9+aBAyDd1tuNT7HJw4=";
14 };
1516+ npmDepsHash = "sha256-kI7kgSw0xs8Hsa/5lhLteDo8TgwyxIxKE1QK92D1Qio=";
1718 installPhase = ''
19 runHook preInstall
···2021buildGoModule rec {
22 pname = "gitea";
23- version = "1.21.2";
2425 # not fetching directly from the git repo, because that lacks several vendor files for the web UI
26 src = fetchurl {
27 url = "https://dl.gitea.com/gitea/${version}/gitea-src-${version}.tar.gz";
28- hash = "sha256-+zG4tyJjSwocIDVwOj4RhwF7h/6WBCOG/6j4B1ADXas=";
29 };
3031 vendorHash = null;
···2021buildGoModule rec {
22 pname = "gitea";
23+ version = "1.21.3";
2425 # not fetching directly from the git repo, because that lacks several vendor files for the web UI
26 src = fetchurl {
27 url = "https://dl.gitea.com/gitea/${version}/gitea-src-${version}.tar.gz";
28+ hash = "sha256-tJC9p7++lb3lD0yYR4qAtFOTRBQK2SkNCD6Tk+g9M78=";
29 };
3031 vendorHash = null;
···1{ lib
2, callPackage
3, config
4+, runCommand
5}:
67+let
8+ buildLua = callPackage ./buildLua.nix { };
9+10+ unionOfDisjoints = lib.fold lib.attrsets.unionOfDisjoint {};
11+12+ addTests = name: drv: let
13+ inherit (drv) scriptName;
14+ scriptPath = "share/mpv/scripts/${scriptName}";
15+ fullScriptPath = "${drv}/${scriptPath}";
16+17+ in drv.overrideAttrs (old: { passthru = (old.passthru or {}) // { tests = unionOfDisjoints [
18+ (old.passthru.tests or {})
19+20+ {
21+ scriptName-is-valid = runCommand "mpvScripts.${name}.passthru.tests.scriptName-is-valid" {
22+ meta.maintainers = with lib.maintainers; [ nicoo ];
23+ preferLocalBuild = true;
24+ } ''
25+ if [ -e "${fullScriptPath}" ]; then
26+ touch $out
27+ else
28+ echo "mpvScripts.\"${name}\" does not contain a script named \"${scriptName}\"" >&2
29+ exit 1
30+ fi
31+ '';
32+ }
33+34+ # can't check whether `fullScriptPath` is a directory, in pure-evaluation mode
35+ (with lib; optionalAttrs (! any (s: hasSuffix s drv.passthru.scriptName) [ ".js" ".lua" ".so" ]) {
36+ single-main-in-script-dir = runCommand "mpvScripts.${name}.passthru.tests.single-main-in-script-dir" {
37+ meta.maintainers = with lib.maintainers; [ nicoo ];
38+ preferLocalBuild = true;
39+ } ''
40+ die() {
41+ echo "$@" >&2
42+ exit 1
43+ }
44+45+ cd "${drv}/${scriptPath}" # so the glob expands to filenames only
46+ mains=( main.* )
47+ if [ "''${#mains[*]}" -eq 1 ]; then
48+ touch $out
49+ elif [ "''${#mains[*]}" -eq 0 ]; then
50+ die "'${scriptPath}' contains no 'main.*' file"
51+ else
52+ die "'${scriptPath}' contains multiple 'main.*' files:" "''${mains[*]}"
53+ fi
54+ '';
55+ })
56+ ]; }; });
57+in
58+59+lib.recurseIntoAttrs
60+ (lib.mapAttrs addTests ({
61 acompressor = callPackage ./acompressor.nix { inherit buildLua; };
62 autocrop = callPackage ./autocrop.nix { };
63 autodeint = callPackage ./autodeint.nix { };
···81 vr-reversal = callPackage ./vr-reversal.nix { };
82 webtorrent-mpv-hook = callPackage ./webtorrent-mpv-hook.nix { };
83 }
84+ // (callPackage ./occivink.nix { inherit buildLua; })))
85 // lib.optionalAttrs config.allowAliases {
86 youtube-quality = throw "'youtube-quality' is no longer maintained, use 'quality-menu' instead"; # added 2023-07-14
87}
+2
pkgs/applications/video/mpv/scripts/mpvacious.nix
···32 runHook postInstall
33 '';
340035 meta = with lib; {
36 description = "Adds mpv keybindings to create Anki cards from movies and TV shows";
37 homepage = "https://github.com/Ajatt-Tools/mpvacious";
···32 runHook postInstall
33 '';
3435+ passthru.scriptName = "mpvacious";
36+37 meta = with lib; {
38 description = "Adds mpv keybindings to create Anki cards from movies and TV shows";
39 homepage = "https://github.com/Ajatt-Tools/mpvacious";
···13 };
1415 scriptPath = ".";
16- passthru.scriptName = "webui.lua";
1718 meta = with lib; {
19 description = "A web based user interface with controls for the mpv mediaplayer";
···13 };
1415 scriptPath = ".";
16+ passthru.scriptName = "webui";
1718 meta = with lib; {
19 description = "A web based user interface with controls for the mpv mediaplayer";