Skip to content

Commit 9100ae5

Browse files
committed
workbench: remove duplicate code/file
1 parent 038fff2 commit 9100ae5

File tree

3 files changed

+16
-169
lines changed

3 files changed

+16
-169
lines changed

nix/pkgs.nix

+7-12
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,10 @@ final: prev: with final; {
8888
# See https://input-output-hk.github.io/haskell.nix/user-guide/development/
8989
workbench-instance =
9090
let backendRegistry =
91-
{
92-
supervisor = {
93-
backend-workbench = ./workbench/backend/supervisor.nix;
94-
workbench-runner = ./workbench/backend/supervisor-run.nix;
95-
};
96-
nomad = {
97-
backend-workbench = ./workbench/backend/nomad.nix;
98-
workbench-runner = ./workbench/backend/nomad-run.nix;
99-
};
100-
};
91+
{
92+
supervisor = ./workbench/backend/supervisor.nix;
93+
nomad = ./workbench/backend/nomad.nix;
94+
};
10195
in
10296
{ backendName
10397
, profileName ? customConfig.localCluster.profileName
@@ -106,10 +100,11 @@ final: prev: with final; {
106100
, workbenchDevMode ? false
107101
, profiled ? false
108102
, workbench ? pkgs.workbench
109-
, backendWorkbench ? pkgs.callPackage (backendRegistry."${backendName}".backend-workbench) { inherit useCabalRun workbench; }
103+
, backendWorkbench ? pkgs.callPackage (backendRegistry."${backendName}")
104+
{ inherit useCabalRun workbench; }
110105
, cardano-node-rev ? null
111106
}:
112-
pkgs.callPackage (backendRegistry."${backendName}".workbench-runner)
107+
pkgs.callPackage ./workbench/backend/run.nix
113108
{
114109
inherit batchName profileName backendWorkbench cardano-node-rev;
115110
};

nix/workbench/backend/nomad-run.nix

-153
This file was deleted.

nix/workbench/backend/supervisor-run.nix renamed to nix/workbench/backend/run.nix

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
let
2-
backendName = "supervisor";
32
batchNameDefault = "plain";
43
profileNameDefault = "default-bage";
54
in
@@ -16,6 +15,10 @@ in
1615
let
1716
inherit (backendWorkbench) workbench backend cacheDir stateDir basePort;
1817

18+
backendName = backendWorkbench.backend.name;
19+
20+
useCabalRun = backendWorkbench.backend.useCabalRun;
21+
1922
with-backend-profile =
2023
{ envArgsOverride ? {} }: ## TODO: envArgsOverride is not used!
2124
workbench.with-profile
@@ -46,7 +49,7 @@ in
4649
--profile ${profile} \
4750
--cache-dir ${cacheDir} \
4851
--base-port ${toString basePort} \
49-
''${WB_MODE_CABAL:+--cabal} \
52+
${pkgs.lib.optionalString useCabalRun ''--cabal \''}
5053
"$@"
5154
'';
5255

@@ -86,10 +89,12 @@ in
8689
moreutils
8790
nixWrapped
8891
pstree
89-
python3Packages.supervisor
9092
workbench.workbench
9193
zstd
92-
];
94+
]
95+
++
96+
backendWorkbench.backend.extraShellPkgs
97+
;
9398
}
9499
''
95100
mkdir -p $out/{cache,nix-support}

0 commit comments

Comments
 (0)