Skip to content

Commit 8492a73

Browse files
committed
build(nix): Add a "profiled" flake variant
1 parent 69038e2 commit 8492a73

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

flake.nix

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,23 @@
319319
};
320320
inherit (docker) cardano-db-sync-docker cardano-smash-server-docker;
321321

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+
};
338+
322339
# TODO: macOS builders are resource-constrained and cannot run the detabase
323340
# integration tests. Add these back when we get beefier builders.
324341
nonRequiredMacOSPaths = [
@@ -347,7 +364,8 @@
347364
} // lib.optionalAttrs (system == "x86_64-darwin") {
348365
inherit cardano-db-sync-macos;
349366
} // {
350-
inherit cardano-smash-server-no-basic-auth;
367+
inherit cardano-smash-server-no-basic-auth profiled;
368+
351369
checks = staticChecks;
352370
};
353371

@@ -364,7 +382,7 @@
364382
} // lib.optionalAttrs (system == "x86_64-darwin") {
365383
inherit cardano-db-sync-macos;
366384
} // {
367-
inherit cardano-smash-server-no-basic-auth;
385+
inherit cardano-smash-server-no-basic-auth profiled;
368386
};
369387
})) // {
370388
nixosModules = {

0 commit comments

Comments
 (0)