nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 rustPlatform,
6 makeWrapper,
7 perf,
8 nix-update-script,
9}:
10
11rustPlatform.buildRustPackage rec {
12 pname = "cargo-flamegraph";
13 version = "0.6.11";
14
15 src = fetchFromGitHub {
16 owner = "flamegraph-rs";
17 repo = "flamegraph";
18 rev = "v${version}";
19 sha256 = "sha256-WPWS3NX6t8RNNALqYF2JMLI5HWVhsVmhg9ULZKt972I=";
20 };
21
22 cargoHash = "sha256-U/Cs4HRNuxq7RaWHmmLoWbiZgqumSRFRLpe1N/63q+E=";
23
24 nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ makeWrapper ];
25
26 postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
27 wrapProgram $out/bin/cargo-flamegraph \
28 --set-default PERF ${perf}/bin/perf
29 wrapProgram $out/bin/flamegraph \
30 --set-default PERF ${perf}/bin/perf
31 '';
32
33 passthru.updateScript = nix-update-script { };
34
35 meta = {
36 description = "Easy flamegraphs for Rust projects and everything else, without Perl or pipes <3";
37 homepage = "https://github.com/flamegraph-rs/flamegraph";
38 license = with lib.licenses; [
39 asl20 # or
40 mit
41 ];
42 maintainers = with lib.maintainers; [
43 killercup
44 matthiasbeyer
45 ];
46 };
47}