nixpkgs/pkgs/by-name/et/etcd_3_5/package.nix
R. Ryantm 156c775371 etcd_3_5: 3.5.31 -> 3.5.32
(cherry picked from commit 88ce6ae2b5)
2026-07-05 10:41:14 +00:00

113 lines
2.1 KiB
Nix

{
buildGoModule,
fetchFromGitHub,
lib,
nixosTests,
symlinkJoin,
}:
let
version = "3.5.32";
etcdSrcHash = "sha256-pqCMgY5veIF5kQDjqTg9B7aSL+V6bdMZpc464wjTLMo=";
etcdServerVendorHash = "sha256-FDzAF2J9wbRmQETvrdJK3gL4cfAhiiihb5EOrimE11M=";
etcdUtlVendorHash = "sha256-0xfq7f7Xr3SWxiU8C1bWQPxdFvEaoIrlK+gX3hkd4ho=";
etcdCtlVendorHash = "sha256-59e/TORi/XX+GXRjMO/45SMumYgrFbOHEXqV7sM72H8=";
src = fetchFromGitHub {
owner = "etcd-io";
repo = "etcd";
tag = "v${version}";
hash = etcdSrcHash;
};
env = {
CGO_ENABLED = 0;
};
meta = {
description = "Distributed reliable key-value store for the most critical data of a distributed system";
license = lib.licenses.asl20;
homepage = "https://etcd.io/";
maintainers = with lib.maintainers; [
dtomvan
superherointj
];
platforms = lib.platforms.darwin ++ lib.platforms.linux;
};
etcdserver = buildGoModule {
pname = "etcdserver";
inherit
env
meta
src
version
;
__darwinAllowLocalNetworking = true;
vendorHash = etcdServerVendorHash;
modRoot = "./server";
preInstall = ''
mv $GOPATH/bin/{server,etcd}
'';
# We set the GitSHA to `GitNotFound` to match official build scripts when
# git is unavailable. This is to avoid doing a full Git Checkout of etcd.
# User facing version numbers are still available in the binary, just not
# the sha it was built from.
ldflags = [ "-X go.etcd.io/etcd/api/v3/version.GitSHA=GitNotFound" ];
};
etcdutl = buildGoModule {
pname = "etcdutl";
inherit
env
meta
src
version
;
vendorHash = etcdUtlVendorHash;
modRoot = "./etcdutl";
};
etcdctl = buildGoModule {
pname = "etcdctl";
inherit
env
meta
src
version
;
vendorHash = etcdCtlVendorHash;
modRoot = "./etcdctl";
};
in
symlinkJoin {
pname = "etcd";
inherit meta version;
passthru = {
deps = {
inherit etcdserver etcdutl etcdctl;
};
tests = nixosTests.etcd."3_5";
updateScript = ./update.sh;
};
paths = [
etcdserver
etcdutl
etcdctl
];
}