riir
This commit is contained in:
parent
da4bc139eb
commit
66cbf003f8
44 changed files with 7166 additions and 5426 deletions
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# Usage:
|
||||
# { pkgs, ... }: {
|
||||
# imports = [ ./path/to/inshellah/nix/module.nix ];
|
||||
# imports = [ ./path/to/inshellah-rs/nix/module.nix ];
|
||||
# programs.inshellah.enable = true;
|
||||
# }
|
||||
|
||||
|
|
@ -72,6 +72,26 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
timeoutMs = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.int;
|
||||
default = null;
|
||||
example = 200;
|
||||
description = ''
|
||||
per-subprocess timeout in milliseconds. when null the binary's
|
||||
compiled-in default is used (currently 200ms).
|
||||
'';
|
||||
};
|
||||
|
||||
workers = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.int;
|
||||
default = null;
|
||||
example = 8;
|
||||
description = ''
|
||||
worker thread count for the parallel scrape pool. when null,
|
||||
`std::thread::available_parallelism` is used.
|
||||
'';
|
||||
};
|
||||
|
||||
snippet = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
readOnly = true;
|
||||
|
|
@ -109,12 +129,14 @@ in
|
|||
lib.concatStringsSep "\n" cfg.helpOnlyCommands
|
||||
);
|
||||
helpOnlyFlag = lib.optionalString (cfg.helpOnlyCommands != [ ]) " --help-only ${helpOnlyFile}";
|
||||
timeoutFlag = lib.optionalString (cfg.timeoutMs != null) " --timeout-ms ${toString cfg.timeoutMs}";
|
||||
workersFlag = lib.optionalString (cfg.workers != null) " --workers ${toString cfg.workers}";
|
||||
in
|
||||
''
|
||||
mkdir -p ${destDir}
|
||||
|
||||
if [ -d "$out/bin" ] && [ -d "$out/share/man" ]; then
|
||||
${inshellah} index "$out" --dir ${destDir}${ignoreFlag}${helpOnlyFlag} \
|
||||
${inshellah} index "$out" --dir ${destDir}${ignoreFlag}${helpOnlyFlag}${timeoutFlag}${workersFlag} \
|
||||
2>/dev/null || true
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue