nixpkgs/pkgs/by-name/im/immudb/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

72 lines
1.9 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, fetchzip
, installShellFiles
}:
let
webconsoleVersion = "1.0.18";
webconsoleDist = fetchzip {
url = "https://github.com/codenotary/immudb-webconsole/releases/download/v${webconsoleVersion}/immudb-webconsole.tar.gz";
sha256 = "sha256-4BhTK+gKO8HW1CelGa30THpfkqfqFthK+b7p9QWl4Pw=";
};
in
buildGoModule rec {
pname = "immudb";
version = "1.9.5";
src = fetchFromGitHub {
owner = "codenotary";
repo = pname;
rev = "v${version}";
sha256 = "sha256-XKioPk0Rv+I916OLInJEtOaDV9KcBMWSHmPOq2k3LTQ=";
};
postPatch = ''
EXPECTED_WEBCONSOLE_STRING='DEFAULT_WEBCONSOLE_VERSION=${webconsoleVersion}'
if ! grep -F "$EXPECTED_WEBCONSOLE_STRING" Makefile ; then
echo "Did not find $EXPECTED_WEBCONSOLE_STRING in Makefile. " \
"Our webconsole version may need bumping (or the Makefile may have changed)"
exit 3
fi
'';
preBuild = ''
mkdir -p webconsole/dist
cp -r ${webconsoleDist}/* ./webconsole/dist
go generate -tags webconsole ./webconsole
'';
vendorHash = "sha256-6DHmJrE+xkf8K38a8h1VSD33W6qj594Q5bJJXnfSW0Q=";
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 ];
};
}