This repository has been archived by the owner on Nov 20, 2023. It is now read-only.
forked from IntersectMBO/cardano-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pkgs.nix
141 lines (124 loc) · 4.8 KB
/
pkgs.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# our packages overlay
final: prev:
let
inherit (prev) customConfig;
inherit (final) pkgs cardanoNodePackages cardanoNodeProject;
inherit (prev.pkgs) lib;
# A generic, fully parameteric version of the workbench development environment.
workbench = pkgs.callPackage ./workbench {};
# A conveniently-parametrisable workbench preset.
# See https://input-output-hk.github.io/haskell.nix/user-guide/development/
# The general idea is:
# 1. backendName -> stateDir -> basePort -> useCabalRun -> backend
# 2. batchName -> profileName -> profiling -> backend -> workbench -> runner
# * `workbench` is in case a pinned version of the workbench is needed.
workbench-runner =
let
backendRegistry =
{
nomadcloud = params:
import ./workbench/backend/nomad/cloud.nix params;
nomadexec = params:
import ./workbench/backend/nomad/exec.nix params;
nomadpodman = params:
import ./workbench/backend/nomad/podman.nix params;
supervisor = params:
import ./workbench/backend/supervisor.nix params;
}
;
in
{ stateDir ? customConfig.localCluster.stateDir
, batchName ? customConfig.localCluster.batchName
, profileName ? customConfig.localCluster.profileName
, backendName ? customConfig.localCluster.backendName
, basePort ? customConfig.localCluster.basePort
, useCabalRun ? customConfig.localCluster.useCabalRun
, workbenchDevMode ? customConfig.localCluster.workbenchDevMode
, workbenchStartArgs ? customConfig.localCluster.workbenchStartArgs
, profiling ? customConfig.profiling
, cardano-node-rev ? null
, workbench ? pkgs.workbench
}:
let
# The `useCabalRun` flag is set in the backend to allow the backend to
# override its value. The runner uses the value of `useCabalRun` from
# the backend to prevent a runner using a different value.
backend = (backendRegistry."${backendName}")
{ inherit pkgs lib stateDir basePort useCabalRun; };
in import ./workbench/backend/runner.nix
{
inherit pkgs lib cardanoNodePackages;
inherit batchName profileName backend;
inherit cardano-node-rev;
inherit workbench workbenchDevMode workbenchStartArgs profiling;
};
# Workbench instantiated by parameters from customConfig:
custom-config-workbench-runner = workbench-runner {};
in with final;
{
inherit (cardanoNodeProject.args) compiler-nix-name;
inherit workbench workbench-runner;
cabal = haskell-nix.cabal-install.${compiler-nix-name};
hlint = haskell-nix.tool compiler-nix-name "hlint" {
version = {ghc8107 = "3.4.1";}.${compiler-nix-name} or "3.5";
index-state = "2023-01-20T05:50:56Z";
};
ghcid = haskell-nix.tool compiler-nix-name "ghcid" {
version = "0.8.7";
index-state = "2023-01-20T05:50:56Z";
};
haskell-language-server = haskell-nix.tool compiler-nix-name "haskell-language-server" rec {
src = haskell-nix.sources."hls-1.10";
cabalProject = builtins.readFile (src + "/cabal.project");
sha256map."https://github.com/pepeiborra/ekg-json"."7a0af7a8fd38045fd15fb13445bdcc7085325460" = "sha256-fVwKxGgM0S4Kv/4egVAAiAjV7QB5PBqMVMCfsv7otIQ=";
};
haskellBuildUtils = prev.haskellBuildUtils.override {
inherit compiler-nix-name;
index-state = "2023-01-20T05:50:56Z";
};
cardanolib-py = callPackage ./cardanolib-py { };
scripts = lib.recursiveUpdate (import ./scripts.nix { inherit pkgs; })
(import ./scripts-submit-api.nix { inherit pkgs; });
clusterTests = import ./workbench/tests { inherit pkgs; };
dockerImage =
let
defaultConfig = {
stateDir = "/data";
dbPrefix = "db";
socketPath = "/ipc/node.socket";
};
in
callPackage ./docker {
exe = "cardano-node";
scripts = import ./scripts.nix {
inherit pkgs;
customConfigs = [ defaultConfig customConfig ];
};
script = "node";
};
submitApiDockerImage =
let
defaultConfig = {
socketPath = "/node-ipc/node.socket";
listenAddress = "0.0.0.0";
};
in
callPackage ./docker/submit-api.nix {
exe = "cardano-submit-api";
scripts = import ./scripts-submit-api.nix {
inherit pkgs;
customConfigs = [ defaultConfig customConfig ];
};
script = "submit-api";
};
all-profiles-json = workbench.profile-names-json;
# Disable failing python uvloop tests
python38 = prev.python38.override {
packageOverrides = pythonFinal: pythonPrev: {
uvloop = pythonPrev.uvloop.overrideAttrs (attrs: {
disabledTestPaths = [ "tests/test_tcp.py" "tests/test_sourcecode.py" "tests/test_dns.py" ];
});
};
};
} //
custom-config-workbench-runner.overlay final prev