1 { lib, buildGoModule, fetchFromGitHub, symlinkJoin, nixosTests, k3s }:
5 etcdSrcHash = "sha256-6dQXgM6VEWwv5CfHvxxPxdhMwNjFsinwhsbSqvQoDxI=";
6 etcdServerVendorHash = "sha256-PB4gACfeYhdOXYs0xbcq2CmSMJnf/ifX2U2DN6zfJ1o=";
7 etcdUtlVendorHash = "sha256-f23mn4zE6beM8yPSbs9gEEEifyF2D+CVKdlYwQtzAkQ=";
8 etcdCtlVendorHash = "sha256-gSlyhmLKarDwc+MhYuTeTqwj0wLiN6+k2bHEVVTkyPc=";
10 src = fetchFromGitHub {
20 description = "Distributed reliable key-value store for the most critical data of a distributed system";
21 license = licenses.asl20;
22 homepage = "https://etcd.io/";
23 maintainers = with maintainers; [ endocrimes offline superherointj ];
24 platforms = platforms.darwin ++ platforms.linux;
27 etcdserver = buildGoModule rec {
30 inherit CGO_ENABLED meta src version;
32 vendorHash = etcdServerVendorHash;
37 mv $GOPATH/bin/{server,etcd}
40 # We set the GitSHA to `GitNotFound` to match official build scripts when
41 # git is unavailable. This is to avoid doing a full Git Checkout of etcd.
42 # User facing version numbers are still available in the binary, just not
43 # the sha it was built from.
44 ldflags = [ "-X go.etcd.io/etcd/api/v3/version.GitSHA=GitNotFound" ];
47 etcdutl = buildGoModule rec {
50 inherit CGO_ENABLED meta src version;
52 vendorHash = etcdUtlVendorHash;
54 modRoot = "./etcdutl";
57 etcdctl = buildGoModule rec {
60 inherit CGO_ENABLED meta src version;
62 vendorHash = etcdCtlVendorHash;
64 modRoot = "./etcdctl";
68 name = "etcd-${version}";
73 inherit etcdserver etcdutl etcdctl;
75 inherit (nixosTests) etcd etcd-cluster;
76 k3s = k3s.passthru.tests.etcd;
78 updateScript = ./update.sh;