about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/pgtop/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/tools/pgtop/default.nix')
-rw-r--r--nixpkgs/pkgs/development/tools/pgtop/default.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/pgtop/default.nix b/nixpkgs/pkgs/development/tools/pgtop/default.nix
new file mode 100644
index 000000000000..03b3ef89265b
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/pgtop/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, perlPackages, fetchFromGitHub, shortenPerlShebang }:
+
+perlPackages.buildPerlPackage rec {
+  pname = "pgtop";
+  version = "0.11";
+
+  src = fetchFromGitHub {
+    owner = "cosimo";
+    repo = "pgtop";
+    rev = "v${version}";
+    sha256 = "1awyl6ddfihm7dfr5y2z15r1si5cyipnlyyj3m1l19pk98s4x66l";
+  };
+
+  outputs = [ "out" ];
+
+  buildInputs = with perlPackages; [ DBI DBDPg TermReadKey JSON LWPUserAgent ];
+
+  nativeBuildInputs = lib.optional stdenv.isDarwin shortenPerlShebang;
+  postInstall = lib.optionalString stdenv.isDarwin ''
+    shortenPerlShebang $out/bin/pgtop
+  '';
+
+  meta = with lib; {
+    description = "a PostgreSQL clone of `mytop', which in turn is a `top' clone for MySQL";
+    homepage = "https://github.com/cosimo/pgtop";
+    changelog = "https://github.com/cosimo/pgtop/releases/tag/v${version}";
+    maintainers = [ maintainers.hagl ];
+    license = [ licenses.gpl2Only ];
+  };
+}