1{ lib, stdenv, fetchFromGitHub, postgresql }:
2
3stdenv.mkDerivation rec {
4 pname = "pg_cron";
5 version = "1.6.2";
6
7 buildInputs = [ postgresql ];
8
9 src = fetchFromGitHub {
10 owner = "citusdata";
11 repo = pname;
12 rev = "v${version}";
13 hash = "sha256-/dD1gX0+RRsBFIjSV9TVk+ppPw0Jrzssl+rRZ2qAp4w=";
14 };
15
16 installPhase = ''
17 mkdir -p $out/{lib,share/postgresql/extension}
18
19 cp *${postgresql.dlSuffix} $out/lib
20 cp *.sql $out/share/postgresql/extension
21 cp *.control $out/share/postgresql/extension
22 '';
23
24 meta = with lib; {
25 description = "Run Cron jobs through PostgreSQL";
26 homepage = "https://github.com/citusdata/pg_cron";
27 changelog = "https://github.com/citusdata/pg_cron/raw/v${version}/CHANGELOG.md";
28 maintainers = with maintainers; [ thoughtpolice ];
29 platforms = postgresql.meta.platforms;
30 license = licenses.postgresql;
31 };
32}