1{ stdenv, fetchFromGitHub, postgresql }:
2
3# # To enable on NixOS:
4# config.services.postgresql = {
5# extraPlugins = [ pkgs.timescaledb ];
6# extraConfig = "shared_preload_libraries = 'timescaledb'";
7# }
8
9stdenv.mkDerivation rec {
10 name = "timescaledb-${version}";
11 version = "0.6.0";
12
13 buildInputs = [ postgresql ];
14
15 src = fetchFromGitHub {
16 owner = "timescale";
17 repo = "timescaledb";
18 rev = version;
19 sha256 = "061z1ll3x7ca7fj12rl2difkdvmqykksqhpsql552qkkylg7iq4d";
20 };
21
22 installPhase = ''
23 mkdir -p $out/bin
24 install -D timescaledb.so -t $out/lib
25 install -D timescaledb.control -t $out/share/extension
26 cp -dpR sql/* $out/share/extension/
27 '';
28
29 meta = with stdenv.lib; {
30 description = "Scales PostgreSQL for time-series data via automatic partitioning across time and space";
31 homepage = https://www.timescale.com/;
32 maintainers = with maintainers; [ volth ];
33 platforms = platforms.linux;
34 license = licenses.postgresql;
35 };
36}