From 9eb3b108e8237c4722cc9334cab82d8918fb9b44 Mon Sep 17 00:00:00 2001 From: Jaka Hudoklin Date: Wed, 28 Jan 2015 16:28:13 +0100 Subject: [PATCH] Add influxdb-backup --- pkgs/servers/nosql/influxdb/backup.nix | 31 +++++++++++++++++++++++ pkgs/servers/nosql/influxdb/deps.nix | 35 ++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 68 insertions(+) create mode 100644 pkgs/servers/nosql/influxdb/backup.nix create mode 100644 pkgs/servers/nosql/influxdb/deps.nix diff --git a/pkgs/servers/nosql/influxdb/backup.nix b/pkgs/servers/nosql/influxdb/backup.nix new file mode 100644 index 000000000000..89cc11004147 --- /dev/null +++ b/pkgs/servers/nosql/influxdb/backup.nix @@ -0,0 +1,31 @@ +{ stdenv, lib, go, fetchgit }: + +stdenv.mkDerivation rec { + version = "4556edb"; + name = "influxdb-backup-${version}"; + + src = import ./deps.nix { + inherit stdenv lib fetchgit; + }; + + buildInputs = [ go ]; + + buildPhase = '' + export GOPATH=$src + go build -v -o influxdb-dump github.com/eckardt/influxdb-backup/influxdb-dump + go build -v -o influxdb-restore github.com/eckardt/influxdb-backup/influxdb-restore + ''; + + installPhase = '' + mkdir -p $out/bin + mv influxdb-dump $out/bin + mv influxdb-restore $out/bin + ''; + + meta = with stdenv.lib; { + description = "Backup and Restore for InfluxDB"; + homepage = https://github.com/eckardt/influxdb-backup; + maintainers = with maintainers; [ offline ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/servers/nosql/influxdb/deps.nix b/pkgs/servers/nosql/influxdb/deps.nix new file mode 100644 index 000000000000..faafafc2bba5 --- /dev/null +++ b/pkgs/servers/nosql/influxdb/deps.nix @@ -0,0 +1,35 @@ +# This file was generated by go2nix. +{ stdenv, lib, fetchgit }: + +let + goDeps = [ + { + root = "github.com/eckardt/influxdb-backup"; + src = fetchgit { + url = https://github.com/eckardt/influxdb-backup.git; + rev = "4556edbffa914a8c17fa1fa1564962a33c6c7596"; + sha256 = "2928063e6dfe4be7b69c8e72e4d6a5fc557f0c75e9625fadf607d59b8e80e34b"; + }; + } + { + root = "github.com/eckardt/influxdb-go"; + src = fetchgit { + url = https://github.com/eckardt/influxdb-go.git; + rev = "8b71952efc257237e077c5d0672e936713bad38f"; + sha256 = "5318c7e1131ba2330c90a1b67855209e41d3c77811b1d212a96525b42d391f6e"; + }; + } + ]; + +in + +stdenv.mkDerivation rec { + name = "go-deps"; + + buildCommand = + lib.concatStrings + (map (dep: '' + mkdir -p $out/src/`dirname ${dep.root}` + ln -s ${dep.src} $out/src/${dep.root} + '') goDeps); +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1825f32f60ae..3042176881bf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7949,6 +7949,8 @@ let influxdb = callPackage ../servers/nosql/influxdb { }; + influxdb-backup = callPackage ../servers/nosql/influxdb/backup.nix { }; + hyperdex = callPackage ../servers/nosql/hyperdex { }; mysql51 = import ../servers/sql/mysql/5.1.x.nix {