nix: Move parallelCurl to devTools
This is not a with-tool, because it doesn't wrap another command.
This commit is contained in:
+31
-4
@@ -2,6 +2,7 @@
|
|||||||
, cabal-install
|
, cabal-install
|
||||||
, cachix
|
, cachix
|
||||||
, checkedShellScript
|
, checkedShellScript
|
||||||
|
, curl
|
||||||
, devCabalOptions
|
, devCabalOptions
|
||||||
, entr
|
, entr
|
||||||
, git
|
, git
|
||||||
@@ -286,19 +287,45 @@ let
|
|||||||
${hsieMinimalImports} graph-symbols | ${graphviz}/bin/dot -Tpng -o "$_arg_outfile"
|
${hsieMinimalImports} graph-symbols | ${graphviz}/bin/dot -Tpng -o "$_arg_outfile"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
parallelCurl =
|
||||||
|
checkedShellScript
|
||||||
|
{
|
||||||
|
name = "parallel-curl";
|
||||||
|
docs = "wrapper for using <num> parallel curl requests on the same <host>";
|
||||||
|
args = [
|
||||||
|
"ARG_POSITIONAL_SINGLE([num], [number of parallel requests])"
|
||||||
|
"ARG_POSITIONAL_SINGLE([host], [host])"
|
||||||
|
"ARG_LEFTOVERS([extra arguments for curl])"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
''
|
||||||
|
curl_command="${curl}/bin/curl --parallel --parallel-immediate "
|
||||||
|
curl_command+="''${_arg_leftovers[*]} "
|
||||||
|
|
||||||
|
x=1
|
||||||
|
while [ $x -le "$1" ]
|
||||||
|
do
|
||||||
|
curl_command+="$_arg_host "
|
||||||
|
x=$((x + 1))
|
||||||
|
done
|
||||||
|
|
||||||
|
eval "$curl_command"
|
||||||
|
'';
|
||||||
|
|
||||||
in
|
in
|
||||||
buildToolbox
|
buildToolbox
|
||||||
{
|
{
|
||||||
name = "postgrest-dev";
|
name = "postgrest-dev";
|
||||||
tools = [
|
tools = [
|
||||||
watch
|
|
||||||
pushCachix
|
|
||||||
check
|
check
|
||||||
gitHooks
|
|
||||||
dumpMinimalImports
|
dumpMinimalImports
|
||||||
hsieMinimalImports
|
gitHooks
|
||||||
hsieGraphModules
|
hsieGraphModules
|
||||||
hsieGraphSymbols
|
hsieGraphSymbols
|
||||||
|
hsieMinimalImports
|
||||||
|
parallelCurl
|
||||||
|
pushCachix
|
||||||
|
watch
|
||||||
];
|
];
|
||||||
extra = { inherit pushCachix; };
|
extra = { inherit pushCachix; };
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-26
@@ -296,31 +296,6 @@ let
|
|||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
parallelCurl =
|
|
||||||
checkedShellScript
|
|
||||||
{
|
|
||||||
name = "parallel-curl";
|
|
||||||
docs = "wrapper for using <num> parallel curl requests on the same <host>";
|
|
||||||
args = [
|
|
||||||
"ARG_POSITIONAL_SINGLE([num], [number of parallel requests])"
|
|
||||||
"ARG_POSITIONAL_SINGLE([host], [host])"
|
|
||||||
"ARG_LEFTOVERS([extra arguments for curl])"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
''
|
|
||||||
curl_command="${curl}/bin/curl --parallel --parallel-immediate "
|
|
||||||
curl_command+="''${_arg_leftovers[*]} "
|
|
||||||
|
|
||||||
x=1
|
|
||||||
while [ $x -le "$1" ]
|
|
||||||
do
|
|
||||||
curl_command+="$_arg_host "
|
|
||||||
x=$((x + 1))
|
|
||||||
done
|
|
||||||
|
|
||||||
eval "$curl_command"
|
|
||||||
'';
|
|
||||||
|
|
||||||
withPgrst =
|
withPgrst =
|
||||||
checkedShellScript
|
checkedShellScript
|
||||||
{
|
{
|
||||||
@@ -378,7 +353,7 @@ in
|
|||||||
buildToolbox
|
buildToolbox
|
||||||
{
|
{
|
||||||
name = "postgrest-with";
|
name = "postgrest-with";
|
||||||
tools = [ withPgAll withGit withPgrst withSlowPg withSlowPgrst parallelCurl ] ++ withPgVersions;
|
tools = [ withPgAll withGit withPgrst withSlowPg withSlowPgrst ] ++ withPgVersions;
|
||||||
# make withTools available for other nix files
|
# make withTools available for other nix files
|
||||||
extra = { inherit withGit withPg withPgAll withPgrst withSlowPg withSlowPgrst; };
|
extra = { inherit withGit withPg withPgAll withPgrst withSlowPg withSlowPgrst; };
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user