From 53769ebc79e6de6c6bda995277dc7f7b63ddb421 Mon Sep 17 00:00:00 2001 From: Mostly Void <7rat13@gmail.com> Date: Wed, 7 Sep 2022 14:05:58 +0530 Subject: [PATCH 1/2] immudb: init at 1.3.2 --- pkgs/servers/nosql/immudb/default.nix | 65 +++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 67 insertions(+) create mode 100644 pkgs/servers/nosql/immudb/default.nix diff --git a/pkgs/servers/nosql/immudb/default.nix b/pkgs/servers/nosql/immudb/default.nix new file mode 100644 index 000000000000..95a8299ddaf3 --- /dev/null +++ b/pkgs/servers/nosql/immudb/default.nix @@ -0,0 +1,65 @@ +{ lib +, buildGoModule +, fetchFromGitHub +, fetchzip +, installShellFiles +}: + +let + webconsoleVersion = "1.0.17"; + webconsoleDist = fetchzip { + url = "https://github.com/codenotary/immudb-webconsole/releases/download/v${webconsoleVersion}/immudb-webconsole.tar.gz"; + sha256 = "sha256-hFSvPwSRXyrSBYktTOwIRa1+aH+mX/scDYDokvZuW1s="; + }; + +in +buildGoModule rec { + pname = "immudb"; + version = "1.3.2"; + + src = fetchFromGitHub { + owner = "codenotary"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-lcKjeqZeTQQMhVjnWNP3c+HanI/eenfUbpZJAo5FEkM="; + }; + + preBuild = '' + mkdir -p webconsole/dist + cp -r ${webconsoleDist}/* ./webconsole/dist + go generate -tags webconsole ./webconsole + ''; + + proxyVendor = true; # check if this is needed anymore when updating + + vendorSha256 = "sha256-gMpkV0XqY6wh7s0lndIdCoYlvVBrMk7/lvyDVqnJ66c="; + + nativeBuildInputs = [ installShellFiles ]; + + tags = [ "webconsole" ]; + + ldflags = [ "-X github.com/codenotary/immudb/cmd/version.Version=${version}" ]; + + subPackages = [ + "cmd/immudb" + "cmd/immuclient" + "cmd/immuadmin" + ]; + + postInstall = '' + mkdir -p share/completions + for executable in immudb immuclient immuadmin; do + for shell in bash fish zsh; do + $out/bin/$executable completion $shell > share/completions/$executable.$shell + installShellCompletion share/completions/$executable.$shell + done + done + ''; + + meta = with lib; { + description = "Immutable database based on zero trust, SQL and Key-Value, tamperproof, data change history"; + homepage = "https://github.com/codenotary/immudb"; + license = licenses.asl20; + maintainers = with maintainers; [ dit7ya ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 915e23056427..0c3d5f1f1a86 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23241,6 +23241,8 @@ with pkgs; percona-server56 = callPackage ../servers/sql/percona/5.6.x.nix { stdenv = gcc10StdenvCompat; }; percona-server = percona-server56; + immudb = callPackage ../servers/nosql/immudb { }; + influxdb = callPackage ../servers/nosql/influxdb { # pinned due to build failure or vendoring problems. When unpinning double check with: nix-build -A $name.go-modules --rebuild buildGoModule = buildGo117Module; From 984aa72e0fa3da8b107daf9169730077815bfe04 Mon Sep 17 00:00:00 2001 From: Mostly Void Date: Fri, 16 Sep 2022 11:20:23 +0530 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Anderson Torres --- pkgs/servers/nosql/immudb/default.nix | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pkgs/servers/nosql/immudb/default.nix b/pkgs/servers/nosql/immudb/default.nix index 95a8299ddaf3..a2f56f4f45c9 100644 --- a/pkgs/servers/nosql/immudb/default.nix +++ b/pkgs/servers/nosql/immudb/default.nix @@ -11,7 +11,6 @@ let url = "https://github.com/codenotary/immudb-webconsole/releases/download/v${webconsoleVersion}/immudb-webconsole.tar.gz"; sha256 = "sha256-hFSvPwSRXyrSBYktTOwIRa1+aH+mX/scDYDokvZuW1s="; }; - in buildGoModule rec { pname = "immudb"; @@ -47,14 +46,14 @@ buildGoModule rec { ]; postInstall = '' - mkdir -p share/completions - for executable in immudb immuclient immuadmin; do - for shell in bash fish zsh; do - $out/bin/$executable completion $shell > share/completions/$executable.$shell - installShellCompletion share/completions/$executable.$shell - done - done - ''; + mkdir -p share/completions + for executable in immudb immuclient immuadmin; do + for shell in bash fish zsh; do + $out/bin/$executable completion $shell > share/completions/$executable.$shell + installShellCompletion share/completions/$executable.$shell + done + done + ''; meta = with lib; { description = "Immutable database based on zero trust, SQL and Key-Value, tamperproof, data change history";