nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 47 lines 1.1 kB view raw
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.8"; 14 15 src = fetchFromGitHub { 16 owner = "flamegraph-rs"; 17 repo = "flamegraph"; 18 rev = "v${version}"; 19 sha256 = "sha256-JGUABNCZhDyTTrjFCRsT+wkuAeZn9mCHCI6XgGYEl7Y="; 20 }; 21 22 cargoHash = "sha256-FjLjEoorbZC2WZ424w2aFLmd4dIfy5s13sR8BSRVNIo="; 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 = with lib; { 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 licenses; [ 39 asl20 # or 40 mit 41 ]; 42 maintainers = with maintainers; [ 43 killercup 44 matthiasbeyer 45 ]; 46 }; 47}