2018-04-02 08:40:07 +01:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, postgresql }:
|
2017-09-19 00:42:16 +01:00
|
|
|
|
2017-09-29 11:16:17 +01:00
|
|
|
# # To enable on NixOS:
|
|
|
|
# config.services.postgresql = {
|
|
|
|
# extraPlugins = [ pkgs.timescaledb ];
|
|
|
|
# extraConfig = "shared_preload_libraries = 'timescaledb'";
|
|
|
|
# }
|
|
|
|
|
2017-09-19 00:42:16 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "timescaledb-${version}";
|
2018-05-16 13:47:29 +01:00
|
|
|
version = "0.9.2";
|
2017-09-19 00:42:16 +01:00
|
|
|
|
2018-04-02 08:40:07 +01:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2017-09-19 00:42:16 +01:00
|
|
|
buildInputs = [ postgresql ];
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2018-04-02 08:40:07 +01:00
|
|
|
owner = "timescale";
|
|
|
|
repo = "timescaledb";
|
|
|
|
rev = "refs/tags/${version}";
|
2018-05-16 13:47:29 +01:00
|
|
|
sha256 = "1zgyd407skqbsw2zj3l9hixwlisnj82yb6hbq5khjg9k0ifvvgyp";
|
2017-09-19 00:42:16 +01:00
|
|
|
};
|
|
|
|
|
2018-04-02 08:40:07 +01:00
|
|
|
# Fix the install phase which tries to install into the pgsql extension dir,
|
|
|
|
# and cannot be manually overridden. This is rather fragile but works OK.
|
|
|
|
patchPhase = ''
|
|
|
|
for x in CMakeLists.txt sql/CMakeLists.txt; do
|
|
|
|
substituteInPlace "$x" \
|
|
|
|
--replace 'DESTINATION "''${PG_SHAREDIR}/extension"' "DESTINATION \"$out/share/extension\""
|
|
|
|
done
|
|
|
|
|
|
|
|
for x in src/CMakeLists.txt src/loader/CMakeLists.txt; do
|
|
|
|
substituteInPlace "$x" \
|
|
|
|
--replace 'DESTINATION ''${PG_PKGLIBDIR}' "DESTINATION \"$out/lib\""
|
|
|
|
done
|
2017-09-19 00:42:16 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2017-09-29 11:16:17 +01:00
|
|
|
description = "Scales PostgreSQL for time-series data via automatic partitioning across time and space";
|
2018-04-02 08:40:07 +01:00
|
|
|
homepage = https://www.timescale.com/;
|
2017-09-19 00:42:16 +01:00
|
|
|
maintainers = with maintainers; [ volth ];
|
2018-04-02 08:40:07 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.postgresql;
|
2017-09-19 00:42:16 +01:00
|
|
|
};
|
|
|
|
}
|