about summary refs log tree commit diff
path: root/pkgs/servers/sql/postgresql/ext/system_stats.nix
blob: bc2a0973b95f3051eb2d823a6412b18a5004027a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{
  fetchFromGitHub,
  lib,
  stdenv,
  postgresql,
}:
stdenv.mkDerivation rec {
  pname = "system_stats";
  version = "3.0";

  buildInputs = [ postgresql ];

  src = fetchFromGitHub {
    owner = "EnterpriseDB";
    repo = "system_stats";
    rev = "v${version}";
    hash = "sha256-LuX7/LOi0rl6L/kjbjq7rr2zPcGIOYB7hdZBNJ9xqak=";
  };

  installPhase = ''
    runHook preInstall

    mkdir -p $out/{lib,share/postgresql/extension}

    cp *${postgresql.dlSuffix} $out/lib
    cp *.sql     $out/share/postgresql/extension
    cp *.control $out/share/postgresql/extension

    runHook postInstall
  '';

  meta = with lib; {
    description = "A Postgres extension for exposing system metrics such as CPU, memory and disk information";
    homepage = "https://github.com/EnterpriseDB/system_stats";
    changelog = "https://github.com/EnterpriseDB/system_stats/raw/v${version}/CHANGELOG.md";
    maintainers = with maintainers; [ shivaraj-bh ];
    platforms = postgresql.meta.platforms;
    license = licenses.postgresql;
  };
}