nixpkgs/pkgs/servers/sql/cockroachdb/cockroachdb-bin.nix
Alexis Hildebrandt 755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00

47 lines
1.4 KiB
Nix

{ lib
, stdenv
, fetchzip
, buildFHSEnv
}:
let
version = "23.1.14";
pname = "cockroachdb";
# For several reasons building cockroach from source has become
# nearly impossible. See https://github.com/NixOS/nixpkgs/pull/152626
# Therefore we use the pre-build release binary and wrap it with buildFHSUserEnv to
# work on nix.
# You can generate the hashes with
# nix flake prefetch <url>
srcs = {
aarch64-linux = fetchzip {
url = "https://binaries.cockroachdb.com/cockroach-v${version}.linux-arm64.tgz";
hash = "sha256-cwczzmSKKQs/DN6WZ/FF6nJC82Pu47akeDqWdBMgdz0=";
};
x86_64-linux = fetchzip {
url = "https://binaries.cockroachdb.com/cockroach-v${version}.linux-amd64.tgz";
hash = "sha256-goCBE+zv9KArdoMsI48rlISurUM0bL/l1OEYWQKqzv0=";
};
};
src = srcs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
in
buildFHSEnv {
inherit pname version;
runScript = "${src}/cockroach";
extraInstallCommands = ''
cp -P $out/bin/cockroachdb $out/bin/cockroach
'';
meta = with lib; {
homepage = "https://www.cockroachlabs.com";
description = "Scalable, survivable, strongly-consistent SQL database";
license = licenses.bsl11;
platforms = [ "aarch64-linux" "x86_64-linux" ];
maintainers = with maintainers; [ rushmorem thoughtpolice neosimsim ];
};
}