Files
nixpkgs/pkgs/servers/etcd/3_5/default.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

128 lines
2.5 KiB
Nix

{
applyPatches,
buildGoModule,
fetchFromGitHub,
fetchpatch,
k3s,
lib,
nixosTests,
symlinkJoin,
}:
let
version = "3.5.22";
etcdSrcHash = "sha256-tS1IFMxfb8Vk9HJTAK+BGPZiVE3ls4Q2DQSerALOQCc=";
etcdServerVendorHash = "sha256-ul3R0c6RoCqLvlD2dfso1KwfHjsHfzQiUVJZJmz28ks=";
etcdUtlVendorHash = "sha256-S2pje2fTDaZwf6jnyE2YXWcs/fgqF51nxCVfEwg0Gsw=";
etcdCtlVendorHash = "sha256-lZ6o0oWUsc3WiCa87ynm7UAG6VxTf81a301QMSPOvW0=";
src = applyPatches {
src = fetchFromGitHub {
owner = "etcd-io";
repo = "etcd";
tag = "v${version}";
hash = etcdSrcHash;
};
patches = [
(fetchpatch {
url = "https://github.com/etcd-io/etcd/commit/31650ab0c8df43af05fc4c13b48ffee59271eec7.patch";
hash = "sha256-Q94HOLFx2fnb61wMQsAUT4sIBXfxXqW9YEayukQXX18=";
})
];
};
env = {
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; [
dtomvan
];
platforms = platforms.darwin ++ 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 {
name = "etcd-${version}";
inherit meta version;
passthru = {
deps = {
inherit etcdserver etcdutl etcdctl;
};
tests = {
inherit (nixosTests) etcd etcd-cluster;
k3s = k3s.passthru.tests.etcd;
};
updateScript = ./update.sh;
};
paths = [
etcdserver
etcdutl
etcdctl
];
}