2022-01-13 20:06:32 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, symlinkJoin }:
|
|
|
|
|
|
|
|
let
|
2023-02-09 11:40:11 +00:00
|
|
|
version = "3.5.7";
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-01-13 20:06:32 +00:00
|
|
|
owner = "etcd-io";
|
|
|
|
repo = "etcd";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "v${version}";
|
2023-02-09 11:40:11 +00:00
|
|
|
hash = "sha256-VgWY622RJ8f4yA6TRC5IvatVFw2CP5lN3QBS3Xaevbc=";
|
2022-01-13 20:06:32 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
CGO_ENABLED = 0;
|
|
|
|
|
|
|
|
meta = with lib; {
|
2022-01-13 20:06:32 +00:00
|
|
|
description = "Distributed reliable key-value store for the most critical data of a distributed system";
|
|
|
|
license = licenses.asl20;
|
|
|
|
homepage = "https://etcd.io/";
|
|
|
|
maintainers = with maintainers; [ offline zowoq endocrimes ];
|
|
|
|
platforms = platforms.darwin ++ platforms.linux;
|
|
|
|
};
|
|
|
|
|
|
|
|
etcdserver = buildGoModule rec {
|
|
|
|
pname = "etcdserver";
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
inherit CGO_ENABLED meta src version;
|
2022-01-13 20:06:32 +00:00
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
vendorHash = "sha256-w/aWrQF/PAWTGMFUcpHiiDef6cvLLdYP06iwBdxrGkQ=";
|
2022-01-13 20:06:32 +00:00
|
|
|
|
|
|
|
modRoot = "./server";
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
preInstall = ''
|
2022-01-13 20:06:32 +00:00
|
|
|
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 rec {
|
|
|
|
pname = "etcdutl";
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
inherit CGO_ENABLED meta src version;
|
2022-01-13 20:06:32 +00:00
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
vendorHash = "sha256-Bq5vOZCflLDAhhmwSww9JCahfL/JHKa3ZT4cwNXzW90=";
|
2022-01-13 20:06:32 +00:00
|
|
|
|
|
|
|
modRoot = "./etcdutl";
|
|
|
|
};
|
|
|
|
|
|
|
|
etcdctl = buildGoModule rec {
|
2022-06-16 17:23:12 +00:00
|
|
|
pname = "etcdctl";
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
inherit CGO_ENABLED meta src version;
|
2022-01-13 20:06:32 +00:00
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
vendorHash = "sha256-KUr0SrfuE5sh54THdvJwuMO/U6O+civ6onEPzNGqf18=";
|
2022-01-13 20:06:32 +00:00
|
|
|
|
|
|
|
modRoot = "./etcdctl";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
symlinkJoin {
|
2022-08-12 12:06:08 +00:00
|
|
|
name = "etcd-${version}";
|
|
|
|
|
|
|
|
inherit meta version;
|
|
|
|
|
|
|
|
passthru = { inherit etcdserver etcdutl etcdctl; };
|
2022-01-13 20:06:32 +00:00
|
|
|
|
|
|
|
paths = [
|
|
|
|
etcdserver
|
|
|
|
etcdutl
|
|
|
|
etcdctl
|
|
|
|
];
|
|
|
|
}
|