Skip to content

Commit

Permalink
workbench: get rid of the profileOverrides
Browse files Browse the repository at this point in the history
  • Loading branch information
deepfire committed Jun 28, 2022
1 parent f269c2b commit ab6c3a2
Showing 1 changed file with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions nix/workbench/profiles/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,11 @@
, backend

, profileName
, profileOverride ? {}
}:

let
baseJSON = runWorkbenchJqOnly "profile-${profileName}.json"
"profile json ${profileName}";
JSON =
if profileOverride == {}
then baseJSON
else
runJq "profile-${profileName}-overridden.json"
''--slurpfile profile ${baseJSON}
--slurpfile override ${writeText "profile-override.json" profileOverride}
--null-input
''
"($profile[0] * $override[0])";
JSON = runWorkbenchJqOnly "profile-${profileName}.json"
"profile json ${profileName}";

value = __fromJSON (__readFile JSON);

Expand All @@ -31,16 +20,15 @@ let
inherit JSON value;

topology.files =
runCommand "topology-${profile.name}" {}
"${workbench}/bin/wb topology make ${profile.JSON} $out";
runCommand "topology-${profileName}" {}
"${workbench}/bin/wb topology make ${JSON} $out";

node-specs =
rec {
JSON = runWorkbenchJqOnly
"node-specs-${profile.name}.json"
"profile node-specs ${profile.JSON}";
{
JSON = runWorkbenchJqOnly "node-specs-${profileName}.json"
"profile node-specs ${JSON}";

value = __fromJSON (__readFile JSON);
value = __fromJSON (__readFile node-specs.JSON);
};

inherit (pkgs.callPackage
Expand Down

0 comments on commit ab6c3a2

Please sign in to comment.