nixpkgs/pkgs/servers/etcd/3.5/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

87 lines
2.1 KiB
Nix
Raw Normal View History

2024-02-14 15:36:10 +03:00
{ lib, buildGoModule, fetchFromGitHub, symlinkJoin, nixosTests, k3s }:
2022-01-07 04:18:53 +03:00
let
version = "3.5.15";
etcdSrcHash = "sha256-AY6ug9WU4cFP5sHWrigEPYsF7B386DGtlc689dnrbUw=";
etcdServerVendorHash = "sha256-aIvZYc0ouJtEv4nf9IA8kZkmCP9KXuqhv9zEpzEwRF8=";
etcdUtlVendorHash = "sha256-omBRlu3pOmUHEyhxFvUEaGragTl1y5YXn7iLMlQ95CA=";
etcdCtlVendorHash = "sha256-mr2TLEgAM4hMtnN2t8oGIQwI1+8vRQH8VjPDwymfkTY=";
src = fetchFromGitHub {
2022-01-07 04:18:53 +03:00
owner = "etcd-io";
repo = "etcd";
rev = "v${version}";
2024-02-07 17:38:54 +03:00
hash = etcdSrcHash;
2022-01-07 04:18:53 +03:00
};
CGO_ENABLED = 0;
meta = with lib; {
2022-01-07 04:18:53 +03: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 superherointj ];
2022-01-07 04:18:53 +03:00
platforms = platforms.darwin ++ platforms.linux;
};
etcdserver = buildGoModule rec {
pname = "etcdserver";
inherit CGO_ENABLED meta src version;
2022-01-07 04:18:53 +03:00
2024-02-07 17:38:54 +03:00
vendorHash = etcdServerVendorHash;
2022-01-07 04:18:53 +03:00
modRoot = "./server";
2023-02-04 16:50:22 +03:00
preInstall = ''
2022-01-07 04:18:53 +03: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";
inherit CGO_ENABLED meta src version;
2022-01-07 04:18:53 +03:00
2024-02-07 17:38:54 +03:00
vendorHash = etcdUtlVendorHash;
2022-01-07 04:18:53 +03:00
modRoot = "./etcdutl";
};
etcdctl = buildGoModule rec {
2022-06-01 06:30:16 +03:00
pname = "etcdctl";
inherit CGO_ENABLED meta src version;
2022-01-07 04:18:53 +03:00
2024-02-07 17:38:54 +03:00
vendorHash = etcdCtlVendorHash;
2022-01-07 04:18:53 +03:00
modRoot = "./etcdctl";
};
in
symlinkJoin {
name = "etcd-${version}";
inherit meta version;
2023-05-23 23:54:43 +03:00
passthru = {
inherit etcdserver etcdutl etcdctl;
2024-02-14 15:36:10 +03:00
tests = {
inherit (nixosTests) etcd etcd-cluster;
k3s = k3s.passthru.tests.etcd;
};
2024-02-07 17:38:54 +03:00
updateScript = ./update.sh;
2023-05-23 23:54:43 +03:00
};
2022-01-07 04:18:53 +03:00
paths = [
etcdserver
etcdutl
etcdctl
];
}