Skip to content

Commit

Permalink
Add pyroscope/profilecli
Browse files Browse the repository at this point in the history
  • Loading branch information
simonswine committed Feb 27, 2024
1 parent 4aa5cfe commit cfc8424
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
prometheus-node-exporter-smartmon = pkgs.callPackage ./pkgs/prometheus-node-exporter-smartmon { };
prometheus-node-exporter-zfs = pkgs.callPackage ./pkgs/prometheus-node-exporter-zfs { };
prometheus-snmp-exporter-config = pkgs.callPackage ./pkgs/prometheus-snmp-exporter-config { };
pyroscope = pkgs.callPackage ./pkgs/pyroscope { };
profilecli = pkgs.callPackage ./pkgs/profilecli { };
sleepwatcher = pkgs.callPackage ./pkgs/sleepwatcher { };
tplink-switch-exporter = pkgs.callPackage ./pkgs/tplink-switch-exporter { };
tz-cli = pkgs.callPackage ./pkgs/tz-cli { };
Expand Down Expand Up @@ -148,6 +150,8 @@
prometheus-node-exporter-smartmon = pkgs.prometheus-node-exporter-smartmon;
prometheus-node-exporter-zfs = pkgs.prometheus-node-exporter-zfs;
prometheus-snmp-exporter-config = pkgs.prometheus-snmp-exporter-config;
pyroscope = pkgs.pyroscope;
profilecli = pkgs.profilecli;
sleepwatcher = pkgs.callPackage ./pkgs/sleepwatcher { };
tplink-switch-exporter = pkgs.callPackage ./pkgs/tplink-switch-exporter { };
tz-cli = pkgs.tz-cli;
Expand Down
7 changes: 7 additions & 0 deletions pkgs/profilecli/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{ pyroscope }:

pyroscope.overrideAttrs (_: rec {
pname = "profilecli";
subPackages = [ "cmd/profilecli" ];
})

39 changes: 39 additions & 0 deletions pkgs/pyroscope/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{ lib, buildGoModule, fetchFromGitHub }:

buildGoModule rec {
pname = "pyroscope";
version = "1.4.0";
revision = "f8e6d8b01";

src = fetchFromGitHub {
owner = "grafana";
repo = "pyroscope";
rev = "v${version}";
hash = "sha256-/x7X84snzN2orldKV1th5HJmw2iLlsaav61quP44R6k=";
};

vendorHash = "sha256-+B96m6coa1AEO7ss2i7+dWIJG1cHZQI4ZEDx7O6jZUo=";

preBuild = ''
export GOWORK=off
'';

ldflags =
let
prefix = "github.com/grafana/pyroscope/pkg/util/build";
in
[
"-X ${prefix}.Version=${version}"
"-X ${prefix}.Branch=HEAD"
"-X ${prefix}.Revision=${revision}"
];

subPackages = [ "cmd/pyroscope" "cmd/profilecli" ];

meta = with lib; {
description = "Continuous Profiling Platform. Debug performance issues down to a single line of code";
homepage = "https://grafana.com/oss/pyroscope";
license = licenses.agpl3Only;
maintainers = with maintainers; [ simonswine ];
};
}

0 comments on commit cfc8424

Please sign in to comment.