varname + parallel citation

This commit is contained in:
Motiejus Jakštys 2024-07-06 22:54:08 +03:00
parent e4eeaa15f2
commit d24cb6ae11
1 changed files with 6 additions and 2 deletions

View File

@ -53,14 +53,18 @@ Inputs:
"compressor-${ext} needs to have exactly one '{}', found ${builtins.toString matches}"; "compressor-${ext} needs to have exactly one '{}', found ${builtins.toString matches}";
compressorMap = lib.filterAttrs (k: _: (lib.hasPrefix "compressor-" k)) args; compressorMap = lib.filterAttrs (k: _: (lib.hasPrefix "compressor-" k)) args;
mkCmd = ext: prog: let mkCmd = ext: prog: let
fname = builtins.replaceStrings ["{}"] ["\"$fname\""] prog; cmdline = builtins.replaceStrings ["{}"] ["\"$fname\""] prog;
in in
assert validProg ext prog; "${parallel}/bin/sem --id $$ -P$NIX_BUILD_CORES ${fname}"; assert validProg ext prog; "${parallel}/bin/sem --id $$ -P$NIX_BUILD_CORES ${cmdline}";
formatsPipe = builtins.concatStringsSep "|" formats; formatsPipe = builtins.concatStringsSep "|" formats;
in in
runCommand "${drv.name}-compressed" {} '' runCommand "${drv.name}-compressed" {} ''
mkdir $out mkdir $out
export PARALLEL_HOME=$(mktemp -d) export PARALLEL_HOME=$(mktemp -d)
# Displaying the citation notice once per run of compressDrv is fair game
echo will cite | ${parallel}/bin/parallel --citation
${xorg.lndir}/bin/lndir ${drv}/ $out/ ${xorg.lndir}/bin/lndir ${drv}/ $out/
while IFS= read -d "" -r fname; do while IFS= read -d "" -r fname; do