nix: Export all tools on each toolbox

This allows targeting each tool separately for installs.
This commit is contained in:
Wolfgang Walther
2024-02-26 22:06:01 +01:00
parent 08901323a3
commit c7eb4036a1
12 changed files with 51 additions and 45 deletions
+3 -3
View File
@@ -5,12 +5,12 @@
, extra ? { }
}:
let
bash-completion = builtins.map (tool: tool.bash-completion) tools;
bash-completion = builtins.map (tool: (builtins.getAttr tool tools).bash-completion) (builtins.attrNames tools);
env = buildEnv {
inherit name;
paths = builtins.map (tool: tool.bin) tools;
paths = builtins.map (tool: (builtins.getAttr tool tools).bin) (builtins.attrNames tools);
};
in
env // { inherit bash-completion; } // extra
env // tools // { inherit bash-completion; } // extra
+7 -6
View File
@@ -73,10 +73,11 @@ in
buildToolbox
{
name = "postgrest-cabal";
tools = [
build
clean
run
repl
];
tools = {
inherit
build
clean
run
repl;
};
}
+12 -12
View File
@@ -316,16 +316,16 @@ in
buildToolbox
{
name = "postgrest-dev";
tools = [
check
dumpMinimalImports
gitHooks
hsieGraphModules
hsieGraphSymbols
hsieMinimalImports
parallelCurl
pushCachix
watch
];
extra = { inherit pushCachix; };
tools = {
inherit
check
dumpMinimalImports
gitHooks
hsieGraphModules
hsieGraphSymbols
hsieMinimalImports
parallelCurl
pushCachix
watch;
};
}
+2 -4
View File
@@ -42,8 +42,6 @@ in
buildToolbox
{
name = "postgrest-docker";
tools = [ load ];
extra = {
inherit image;
};
tools = { inherit load; };
extra = { inherit image; };
}
+4 -4
View File
@@ -174,14 +174,14 @@ in
buildToolbox
{
name = "postgrest-docs";
tools =
[
tools = {
inherit
build
check
dictcheck
linkcheck
render
serve
spellcheck
];
spellcheck;
};
}
+1 -1
View File
@@ -181,5 +181,5 @@ let
in
buildToolbox {
name = "postgrest-loadtest";
tools = [ loadtest loadtestAgainst report ];
tools = { inherit loadtest loadtestAgainst report; };
}
+1 -1
View File
@@ -24,5 +24,5 @@ in
buildToolbox
{
name = "postgrest-memory";
tools = [ test ];
tools = { inherit test; };
}
+1 -1
View File
@@ -51,5 +51,5 @@ in
buildToolbox
{
name = "postgrest-nixpkgs";
tools = [ upgrade ];
tools = { inherit upgrade; };
}
+1 -1
View File
@@ -133,5 +133,5 @@ in
buildToolbox
{
name = "postgrest-release";
tools = [ dockerHubDescription release ];
tools = { inherit dockerHubDescription release; };
}
+1 -1
View File
@@ -81,5 +81,5 @@ in
buildToolbox
{
name = "postgrest-style";
tools = [ style styleCheck lint ];
tools = { inherit style styleCheck lint; };
}
+4 -4
View File
@@ -193,14 +193,14 @@ in
buildToolbox
{
name = "postgrest-tests";
tools =
[
tools = {
inherit
testSpec
testDoctests
testSpecIdempotence
testIO
dumpSchema
coverage
coverageDraftOverlay
];
coverageDraftOverlay;
};
}
+14 -7
View File
@@ -139,10 +139,7 @@ let
}
(lib.concatStringsSep "\n\n" runners);
# Create a `postgrest-with-postgresql-` for each PostgreSQL version
withPgVersions = builtins.map withTmpDb postgresqlVersions;
withPg = builtins.head withPgVersions;
withPg = withTmpDb (builtins.head postgresqlVersions);
withSlowPg =
checkedShellScript
@@ -353,7 +350,17 @@ in
buildToolbox
{
name = "postgrest-with";
tools = [ withPgAll withGit withPgrst withSlowPg withSlowPgrst ] ++ withPgVersions;
# make withTools available for other nix files
extra = { inherit withGit withPg withPgAll withPgrst withSlowPg withSlowPgrst; };
tools = {
inherit
withGit
withPgAll
withPgrst
withSlowPg
withSlowPgrst;
} // builtins.listToAttrs (
# Create a `postgrest-with-postgresql-` for each PostgreSQL version
builtins.map (pg: { inherit (pg) name; value = withTmpDb pg; }) postgresqlVersions
);
# make latest withPg available for other nix files
extra = { inherit withPg; };
}