Skip to content

Commit fc89bce

Browse files
committed
build(nix): Add profiled exes to hsPkgs
1 parent 4a55040 commit fc89bce

File tree

1 file changed

+32
-25
lines changed

1 file changed

+32
-25
lines changed

flake.nix

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,22 @@
6464
inherit (project.hsPkgs.cardano-cli.components.exes) cardano-cli;
6565
})
6666

67-
(final: prev: {
68-
# The cardano-db-sync NixOS module (nix/nixos/cardano-db-sync-service.nix)
69-
# expects these to be here
70-
inherit (project.exes)
71-
cardano-db-sync
72-
cardano-db-tool
73-
cardano-smash-server;
74-
schema = ./schema;
75-
})
67+
(final: prev:
68+
let
69+
profiled = project.profiled.exes;
70+
in {
71+
# The cardano-db-sync NixOS module (nix/nixos/cardano-db-sync-service.nix)
72+
# expects these to be here
73+
inherit (project.exes)
74+
cardano-db-sync
75+
cardano-db-tool
76+
cardano-smash-server;
77+
78+
cardano-db-sync-profiled = profiled.cardano-db-sync;
79+
cardano-smash-server-profiled = profiled.cardano-smash-server;
80+
81+
schema = ./schema;
82+
})
7683

7784
(final: prev: {
7885
# HLint 3.2.x requires GHC >= 8.10 && < 9.0
@@ -251,6 +258,19 @@
251258
"cardano-db-tool.components.exes.cardano-db-tool"
252259
] prev.hsPkgs;
253260
})
261+
262+
(final: prev: {
263+
profiled = final.appendModule {
264+
modules = [{
265+
enableLibraryProfiling = true;
266+
enableProfiling = true;
267+
packages.cardano-db-sync.configureFlags =
268+
["--ghc-option=-fprof-auto"];
269+
packages.cardano-smash-server.configureFlags =
270+
["--ghc-option=-fprof-auto"];
271+
}];
272+
};
273+
})
254274
];
255275

256276
staticChecks =
@@ -319,22 +339,9 @@
319339
};
320340
inherit (docker) cardano-db-sync-docker cardano-smash-server-docker;
321341

322-
profiled =
323-
let
324-
projectProfiled = (project.appendModule {
325-
modules = [{
326-
enableLibraryProfiling = true;
327-
enableProfiling = true;
328-
packages.cardano-db-sync.configureFlags =
329-
["--ghc-option=-fprof-auto"];
330-
packages.cardano-smash-server.configureFlags =
331-
["--ghc-option=-fprof-auto"];
332-
333-
}];
334-
});
335-
in {
336-
inherit (projectProfiled.exes) cardano-db-sync cardano-smash-server;
337-
};
342+
profiled = {
343+
inherit (project.profiled.exes) cardano-db-sync cardano-smash-server;
344+
};
338345

339346
# TODO: macOS builders are resource-constrained and cannot run the detabase
340347
# integration tests. Add these back when we get beefier builders.

0 commit comments

Comments
 (0)