diff --git a/nix/overlays/build-toolbox/build-toolbox.nix b/nix/overlays/build-toolbox/build-toolbox.nix index e6b33e12f..ceb9eff96 100644 --- a/nix/overlays/build-toolbox/build-toolbox.nix +++ b/nix/overlays/build-toolbox/build-toolbox.nix @@ -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 diff --git a/nix/tools/cabalTools.nix b/nix/tools/cabalTools.nix index fef0d726b..decef9ab1 100644 --- a/nix/tools/cabalTools.nix +++ b/nix/tools/cabalTools.nix @@ -73,10 +73,11 @@ in buildToolbox { name = "postgrest-cabal"; - tools = [ - build - clean - run - repl - ]; + tools = { + inherit + build + clean + run + repl; + }; } diff --git a/nix/tools/devTools.nix b/nix/tools/devTools.nix index 81ad03d70..ad7639a32 100644 --- a/nix/tools/devTools.nix +++ b/nix/tools/devTools.nix @@ -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; + }; } diff --git a/nix/tools/docker/default.nix b/nix/tools/docker/default.nix index 8fdce82c1..a77273bb9 100644 --- a/nix/tools/docker/default.nix +++ b/nix/tools/docker/default.nix @@ -42,8 +42,6 @@ in buildToolbox { name = "postgrest-docker"; - tools = [ load ]; - extra = { - inherit image; - }; + tools = { inherit load; }; + extra = { inherit image; }; } diff --git a/nix/tools/docs.nix b/nix/tools/docs.nix index 100abd916..2b08e526f 100644 --- a/nix/tools/docs.nix +++ b/nix/tools/docs.nix @@ -174,14 +174,14 @@ in buildToolbox { name = "postgrest-docs"; - tools = - [ + tools = { + inherit build check dictcheck linkcheck render serve - spellcheck - ]; + spellcheck; + }; } diff --git a/nix/tools/loadtest.nix b/nix/tools/loadtest.nix index 097375464..5aaf5c913 100644 --- a/nix/tools/loadtest.nix +++ b/nix/tools/loadtest.nix @@ -181,5 +181,5 @@ let in buildToolbox { name = "postgrest-loadtest"; - tools = [ loadtest loadtestAgainst report ]; + tools = { inherit loadtest loadtestAgainst report; }; } diff --git a/nix/tools/memory.nix b/nix/tools/memory.nix index 1dee50e1a..15683275d 100644 --- a/nix/tools/memory.nix +++ b/nix/tools/memory.nix @@ -24,5 +24,5 @@ in buildToolbox { name = "postgrest-memory"; - tools = [ test ]; + tools = { inherit test; }; } diff --git a/nix/tools/nixpkgsTools.nix b/nix/tools/nixpkgsTools.nix index b53aaa04c..8b3f2190b 100644 --- a/nix/tools/nixpkgsTools.nix +++ b/nix/tools/nixpkgsTools.nix @@ -51,5 +51,5 @@ in buildToolbox { name = "postgrest-nixpkgs"; - tools = [ upgrade ]; + tools = { inherit upgrade; }; } diff --git a/nix/tools/release/default.nix b/nix/tools/release/default.nix index 519a50cfc..d3b93705d 100644 --- a/nix/tools/release/default.nix +++ b/nix/tools/release/default.nix @@ -133,5 +133,5 @@ in buildToolbox { name = "postgrest-release"; - tools = [ dockerHubDescription release ]; + tools = { inherit dockerHubDescription release; }; } diff --git a/nix/tools/style.nix b/nix/tools/style.nix index b42b28073..30ce39442 100644 --- a/nix/tools/style.nix +++ b/nix/tools/style.nix @@ -81,5 +81,5 @@ in buildToolbox { name = "postgrest-style"; - tools = [ style styleCheck lint ]; + tools = { inherit style styleCheck lint; }; } diff --git a/nix/tools/tests.nix b/nix/tools/tests.nix index 0f234d430..940130890 100644 --- a/nix/tools/tests.nix +++ b/nix/tools/tests.nix @@ -193,14 +193,14 @@ in buildToolbox { name = "postgrest-tests"; - tools = - [ + tools = { + inherit testSpec testDoctests testSpecIdempotence testIO dumpSchema coverage - coverageDraftOverlay - ]; + coverageDraftOverlay; + }; } diff --git a/nix/tools/withTools.nix b/nix/tools/withTools.nix index 84c91737c..82781b769 100644 --- a/nix/tools/withTools.nix +++ b/nix/tools/withTools.nix @@ -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; }; }