From 0e47540a8022e04845ee35217f0d169a780bd332 Mon Sep 17 00:00:00 2001 From: Federico Mastellone Date: Fri, 13 Sep 2024 15:12:18 +0000 Subject: [PATCH] wb | move `profile-names*` functions back to workbench.nix --- nix/workbench/default.nix | 10 ++++++++-- nix/workbench/profile/profile.nix | 16 +++------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/nix/workbench/default.nix b/nix/workbench/default.nix index b3d995bbb6b..9bc8d3e3f61 100644 --- a/nix/workbench/default.nix +++ b/nix/workbench/default.nix @@ -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 @@ -85,8 +93,6 @@ in pkgs.lib.fix (self: { workbench = self; } ) - profile-names-json - profile-names materialise-profile; # A conveniently-parametrisable workbench preset. diff --git a/nix/workbench/profile/profile.nix b/nix/workbench/profile/profile.nix index 42e26277c19..433d8bb6fd4 100644 --- a/nix/workbench/profile/profile.nix +++ b/nix/workbench/profile/profile.nix @@ -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; }; @@ -240,8 +234,4 @@ let ; in - { - inherit profile-names-json; - inherit profile-names; - inherit materialise-profile; - } + {inherit materialise-profile;}