depot/third_party/nixpkgs/pkgs/servers/etcd/3.5.nix
Default email c7cb07f092 Project import generated by Copybara.
GitOrigin-RevId: 1536926ef5621b09bba54035ae2bb6d806d72ac8
2024-02-29 21:09:43 +01:00

81 lines
1.9 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, symlinkJoin, nixosTests, k3s }:
let
version = "3.5.12";
src = fetchFromGitHub {
owner = "etcd-io";
repo = "etcd";
rev = "v${version}";
hash = "sha256-Z2WXNzFJYfRQCldUspQjUR5NyUzCCINycuEXWaTn4vU=";
};
CGO_ENABLED = 0;
meta = with lib; {
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 endocrimes ];
platforms = platforms.darwin ++ platforms.linux;
};
etcdserver = buildGoModule rec {
pname = "etcdserver";
inherit CGO_ENABLED meta src version;
vendorHash = "sha256-S5cEIV4hKRjn9JFEKWBiSEPytHtVacsSnG6T8dofgyk=";
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 rec {
pname = "etcdutl";
inherit CGO_ENABLED meta src version;
vendorHash = "sha256-Vgp44Kg6zUDYVJU6SiYd8ZEcAWqKPPTsqYafcfk89Cc=";
modRoot = "./etcdutl";
};
etcdctl = buildGoModule rec {
pname = "etcdctl";
inherit CGO_ENABLED meta src version;
vendorHash = "sha256-PZLsekZzwlGzccCirNk9uUj70Ue5LMDs6LMWBI9yivs=";
modRoot = "./etcdctl";
};
in
symlinkJoin {
name = "etcd-${version}";
inherit meta version;
passthru = {
inherit etcdserver etcdutl etcdctl;
tests = {
inherit (nixosTests) etcd etcd-cluster;
k3s = k3s.passthru.tests.etcd;
};
};
paths = [
etcdserver
etcdutl
etcdctl
];
}