Nix evaluator supports evaluation profiling compatible with flamegraph.pl. The profiler samples the nix function call stack at regular intervals. It can be enabled with the eval-profiler setting: