Skip to content

Commit

Permalink
wb | move profile-names* functions back to workbench.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaste committed Sep 13, 2024
1 parent 94fae6b commit 0e47540
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
10 changes: 8 additions & 2 deletions nix/workbench/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,20 @@ let
${pkgs.jq}/bin/jq '${query}' "''${args[@]}" > $out
'';

profile-names-json =
runWorkbench "profile-names.json" "profiles list";

profile-names =
__fromJSON (__readFile profile-names-json);

run-analysis = import ./analyse/analyse.nix;

in pkgs.lib.fix (self: {
inherit workbench' workbench runWorkbench;
inherit runJq;

inherit profile-names-json profile-names;

inherit run-analysis;

inherit
Expand All @@ -85,8 +93,6 @@ in pkgs.lib.fix (self: {
workbench = self;
}
)
profile-names-json
profile-names
materialise-profile;

# A conveniently-parametrisable workbench preset.
Expand Down
16 changes: 3 additions & 13 deletions nix/workbench/profile/profile.nix
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,11 @@ let
latency-service;
};

profile-names-json =
workbench.runWorkbench "profile-names.json" "profiles list";

profile-names =
__fromJSON (__readFile profile-names-json);

materialise-profile =
profileArgs@{ profileName, backend, profiling }:
if ! builtins.elem profileName profile-names
if ! builtins.elem profileName workbench.profile-names
then
throw "No such profile: ${profileName}; Known profiles: ${toString (__attrNames profile-names)}"
throw "No such profile: ${profileName}; Known profiles: ${toString (__attrNames workbench.profile-names)}"
else
let
profileJson = mkProfileJson { inherit profileName; };
Expand Down Expand Up @@ -240,8 +234,4 @@ let
;

in
{
inherit profile-names-json;
inherit profile-names;
inherit materialise-profile;
}
{inherit materialise-profile;}

0 comments on commit 0e47540

Please sign in to comment.