Files
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

71 lines
2.2 KiB
Nix

{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
testers,
kubernetes-kcp,
}:
buildGoModule rec {
pname = "kubernetes-kcp";
version = "0.28.3";
src = fetchFromGitHub {
owner = "kcp-dev";
repo = "kcp";
tag = "v${version}";
hash = "sha256-gZMheiMvAUAV3YqWNA1WmOWpV5hEU7GtQzz57F4rX38=";
};
vendorHash = "sha256-w7mC3CJv/UKQe6jOqwzSZSYIu0K/Z4aNUnAcSg6MwG0=";
subPackages = [ "cmd/kcp" ];
# TODO: The upstream has the additional version information pulled from go.mod
# dependencies.
ldflags = [
"-X k8s.io/client-go/pkg/version.gitCommit=unknown"
"-X k8s.io/client-go/pkg/version.gitTreeState=clean"
"-X k8s.io/client-go/pkg/version.gitVersion=v${version}"
# "-X k8s.io/client-go/pkg/version.gitMajor=${KUBE_MAJOR_VERSION}"
# "-X k8s.io/client-go/pkg/version.gitMinor=${KUBE_MINOR_VERSION}"
"-X k8s.io/client-go/pkg/version.buildDate=unknown"
"-X k8s.io/component-base/version.gitCommit=unknown"
"-X k8s.io/component-base/version.gitTreeState=clean"
"-X k8s.io/component-base/version.gitVersion=v${version}"
# "-X k8s.io/component-base/version.gitMajor=${KUBE_MAJOR_VERSION}"
# "-X k8s.io/component-base/version.gitMinor=${KUBE_MINOR_VERSION}"
"-X k8s.io/component-base/version.buildDate=unknown"
];
# TODO: Check if this is necessary.
# __darwinAllowLocalNetworking = true;
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
$out/bin/kcp completion bash > kcp.bash
$out/bin/kcp completion zsh > kcp.zsh
$out/bin/kcp completion fish > kcp.fish
installShellCompletion kcp.{bash,zsh,fish}
'';
passthru.tests.version = testers.testVersion {
package = kubernetes-kcp;
command = "kcp --version";
# NOTE: Once the go.mod version is pulled in, the version info here needs
# to be also updated.
version = "v${version}";
};
meta = {
homepage = "https://kcp.io";
description = "Kubernetes-like control planes for form-factors and use-cases beyond Kubernetes and container workloads";
mainProgram = "kcp";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [
rytswd
];
};
}