-
Notifications
You must be signed in to change notification settings - Fork 721
/
supervisor.nix
52 lines (48 loc) · 1.2 KB
/
supervisor.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
let
basePort = 30000;
cacheDirDefault = "${__getEnv "HOME"}/.cache/cardano-workbench";
stateDir = "run/current";
in
{ pkgs
, lib
, workbench
##
, cacheDir ? cacheDirDefault
, extraBackendConfig ? {}
, useCabalRun ? false
, enableEKG ? true
##
, ...
}:
with lib;
let
backend =
rec
{ name = "supervisor";
services-config = import ./profiles/services-config.nix {inherit lib workbench basePort stateDir useCabalRun enableEKG;};
materialise-profile =
{ profileNix }:
pkgs.runCommand "workbench-profile-outputs-${profileNix.name}-${name}d" {}
''
mkdir $out
cp ${mkBackendConf profileNix} $out/${name}.conf
'';
## Backend-specific Nix bits:
## mkBackendConf :: Profile -> SupervisorConf
mkBackendConf =
profile:
pkgs.callPackage ./supervisor-conf.nix
{ inherit (profile) node-services generator-service;
inherit
pkgs lib stateDir
basePort
extraBackendConfig;
};
};
in
{
inherit cacheDir stateDir basePort;
inherit workbench;
inherit backend;
inherit services-config;
}