2022-02-12 12:37:12 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
2022-07-27 06:02:19 +00:00
|
|
|
, installShellFiles
|
2022-02-12 12:37:12 +00:00
|
|
|
, bash
|
|
|
|
, openssh
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "k3sup";
|
2022-12-22 09:46:42 +00:00
|
|
|
version = "0.12.12";
|
2022-02-12 12:37:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "alexellis";
|
|
|
|
repo = "k3sup";
|
|
|
|
rev = version;
|
2022-12-22 09:46:42 +00:00
|
|
|
sha256 = "sha256-Fp52PL0oNqpvisiLLqZ+iQ4RSzLaL3UH7S/CAR5h9LA=";
|
2022-02-12 12:37:12 +00:00
|
|
|
};
|
|
|
|
|
2022-07-27 06:02:19 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper installShellFiles ];
|
2022-02-12 12:37:12 +00:00
|
|
|
|
2022-08-28 19:23:19 +00:00
|
|
|
vendorSha256 = "sha256-97m8xz46lvTtZoxO2+pjWmZyZnB2atPuVzYgS9DV+gI=";
|
2022-02-12 12:37:12 +00:00
|
|
|
|
|
|
|
postConfigure = ''
|
|
|
|
substituteInPlace vendor/github.com/alexellis/go-execute/pkg/v1/exec.go \
|
|
|
|
--replace "/bin/bash" "${bash}/bin/bash"
|
|
|
|
'';
|
|
|
|
|
|
|
|
CGO_ENABLED = 0;
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s" "-w"
|
|
|
|
"-X github.com/alexellis/k3sup/cmd.GitCommit=ref/tags/${version}"
|
|
|
|
"-X github.com/alexellis/k3sup/cmd.Version=${version}"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram "$out/bin/k3sup" \
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ openssh ]}
|
2022-07-27 06:02:19 +00:00
|
|
|
|
|
|
|
installShellCompletion --cmd k3sup \
|
|
|
|
--bash <($out/bin/k3sup completion bash) \
|
|
|
|
--zsh <($out/bin/k3sup completion zsh) \
|
|
|
|
--fish <($out/bin/k3sup completion fish)
|
2022-02-12 12:37:12 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/alexellis/k3sup";
|
|
|
|
description = "Bootstrap Kubernetes with k3s over SSH";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ welteki ];
|
|
|
|
};
|
|
|
|
}
|