From 716849c97ee95164c0f99fee64478d98a64a89df Mon Sep 17 00:00:00 2001 From: Volth Date: Mon, 18 Sep 2017 23:42:16 +0000 Subject: [PATCH 1/4] timescaledb: init at 0.4.2 --- .../sql/postgresql/timescaledb/default.nix | 30 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 pkgs/servers/sql/postgresql/timescaledb/default.nix diff --git a/pkgs/servers/sql/postgresql/timescaledb/default.nix b/pkgs/servers/sql/postgresql/timescaledb/default.nix new file mode 100644 index 000000000000..e68d06dcf1f7 --- /dev/null +++ b/pkgs/servers/sql/postgresql/timescaledb/default.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchFromGitHub, postgresql }: + +stdenv.mkDerivation rec { + name = "timescaledb-${version}"; + version = "0.4.2"; + + buildInputs = [ postgresql ]; + + src = fetchFromGitHub { + owner = "timescale"; + repo = "timescaledb"; + rev = version; + sha256 = "0rwcd7wg3kv343b02330nlpqfm6jj5g0d2pkr1pc78cq8prhxx39"; + }; + + installPhase = '' + mkdir -p $out/bin + install -D timescaledb.so -t $out/lib + install -D timescaledb.control -t $out/share/extension + install -D sql/timescaledb--${version}.sql -t $out/share/extension + ''; + + meta = with stdenv.lib; { + description = "TimescaleDB scales PostgreSQL for time-series data via automatic partitioning across time and space"; + homepage = https://www.timescale.com/; + maintainers = with maintainers; [ volth ]; + platforms = platforms.linux; + license = licenses.postgresql; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b8262eb8dbd8..0687cd138b14 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16492,6 +16492,8 @@ with pkgs; timbreid = callPackage ../applications/audio/pd-plugins/timbreid { }; + timescaledb = callPackage ../servers/sql/postgresql/timescaledb {}; + timewarrior = callPackage ../applications/misc/timewarrior { }; timidity = callPackage ../tools/misc/timidity { }; From 0f67947f329e6cb9ff48897408e3ee92749143bf Mon Sep 17 00:00:00 2001 From: volth Date: Sun, 24 Sep 2017 15:39:55 +0000 Subject: [PATCH 2/4] timescaledb: 0.4.2 -> 0.5.0 --- pkgs/servers/sql/postgresql/timescaledb/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/sql/postgresql/timescaledb/default.nix b/pkgs/servers/sql/postgresql/timescaledb/default.nix index e68d06dcf1f7..8e646eb72718 100644 --- a/pkgs/servers/sql/postgresql/timescaledb/default.nix +++ b/pkgs/servers/sql/postgresql/timescaledb/default.nix @@ -2,7 +2,7 @@ stdenv.mkDerivation rec { name = "timescaledb-${version}"; - version = "0.4.2"; + version = "0.5.0"; buildInputs = [ postgresql ]; @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { owner = "timescale"; repo = "timescaledb"; rev = version; - sha256 = "0rwcd7wg3kv343b02330nlpqfm6jj5g0d2pkr1pc78cq8prhxx39"; + sha256 = "01swgjw563c42azxsg55ry7cyiipxkcvfrxmw71jil5dxl3s0fkz"; }; installPhase = '' From a047e19c15ec7ee7f095657e9203fe292c26f57b Mon Sep 17 00:00:00 2001 From: volth Date: Sun, 24 Sep 2017 15:56:22 +0000 Subject: [PATCH 3/4] timescaledb: include schema migration .sql scripts --- pkgs/servers/sql/postgresql/timescaledb/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/sql/postgresql/timescaledb/default.nix b/pkgs/servers/sql/postgresql/timescaledb/default.nix index 8e646eb72718..5810ae868918 100644 --- a/pkgs/servers/sql/postgresql/timescaledb/default.nix +++ b/pkgs/servers/sql/postgresql/timescaledb/default.nix @@ -15,9 +15,9 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/bin - install -D timescaledb.so -t $out/lib - install -D timescaledb.control -t $out/share/extension - install -D sql/timescaledb--${version}.sql -t $out/share/extension + install -D timescaledb.so -t $out/lib + install -D timescaledb.control -t $out/share/extension + cp -dpR sql/* $out/share/extension/ ''; meta = with stdenv.lib; { From 24890984e758a3f9de645181bd758ec8e6af34c0 Mon Sep 17 00:00:00 2001 From: volth Date: Fri, 29 Sep 2017 13:16:17 +0300 Subject: [PATCH 4/4] timescaledb: cosmetics --- pkgs/servers/sql/postgresql/timescaledb/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/sql/postgresql/timescaledb/default.nix b/pkgs/servers/sql/postgresql/timescaledb/default.nix index 5810ae868918..fbf0bfa19265 100644 --- a/pkgs/servers/sql/postgresql/timescaledb/default.nix +++ b/pkgs/servers/sql/postgresql/timescaledb/default.nix @@ -1,5 +1,11 @@ { stdenv, fetchFromGitHub, postgresql }: +# # To enable on NixOS: +# config.services.postgresql = { +# extraPlugins = [ pkgs.timescaledb ]; +# extraConfig = "shared_preload_libraries = 'timescaledb'"; +# } + stdenv.mkDerivation rec { name = "timescaledb-${version}"; version = "0.5.0"; @@ -21,7 +27,7 @@ stdenv.mkDerivation rec { ''; meta = with stdenv.lib; { - description = "TimescaleDB scales PostgreSQL for time-series data via automatic partitioning across time and space"; + description = "Scales PostgreSQL for time-series data via automatic partitioning across time and space"; homepage = https://www.timescale.com/; maintainers = with maintainers; [ volth ]; platforms = platforms.linux;