File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 399
399
let
400
400
pkgs' = self . legacyPackages . ${ pkgs . system } ;
401
401
in {
402
- inherit ( pkgs' ) cardanoLib schema cardano-db-sync ;
402
+ inherit ( pkgs' )
403
+ cardanoLib
404
+ schema
405
+ cardano-db-sync
406
+ cardano-db-sync-profiled ;
403
407
404
408
# cardano-db-tool
405
409
cardanoDbSyncHaskellPackages . cardano-db-tool . components . exes . cardano-db-tool =
Original file line number Diff line number Diff line change 16
16
internal = true ;
17
17
type = lib . types . package ;
18
18
} ;
19
+ profiling = lib . mkOption {
20
+ type = lib . types . bool ;
21
+ default = false ;
22
+ description = ''
23
+ Enable GHC profiling.
24
+ '' ;
25
+ } ;
26
+ rtsArgs = lib . mkOption {
27
+ type = lib . types . listOf lib . types . str ;
28
+ default =
29
+ if cfg . profiling then
30
+ [ "-p" "-hc" "-L200" ]
31
+ else
32
+ [ ] ;
33
+ apply = args :
34
+ if ( args != [ ] ) then
35
+ [ "+RTS" ] ++ args ++ [ "-RTS" ]
36
+ else
37
+ [ ] ;
38
+ description = ''Extra CLI args, to be surrounded by "+RTS"/"-RTS"'' ;
39
+ } ;
19
40
takeSnapshot = lib . mkOption {
20
41
type = lib . types . enum [ "never" "once" "always" ] ;
21
42
default = "never" ;
@@ -146,7 +167,11 @@ in {
146
167
} ;
147
168
package = lib . mkOption {
148
169
type = lib . types . package ;
149
- default = self . cardano-db-sync ;
170
+ default =
171
+ if cfg . profiling then
172
+ self . cardano-db-sync-profiled
173
+ else
174
+ self . cardano-db-sync ;
150
175
} ;
151
176
postgres = {
152
177
generatePGPASS = lib . mkOption {
196
221
--config ${ configFile } \
197
222
--socket-path "$CARDANO_NODE_SOCKET_PATH" \
198
223
--schema-dir ${ self . schema } \
224
+ ${ toString cfg . rtsArgs } \
199
225
'' ${LEDGER_OPTS} \
200
226
'' ${EXTRA_DB_SYNC_ARGS:-}
201
227
'' ;
You can’t perform that action at this time.
0 commit comments