3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/cluster/kops/default.nix

72 lines
1.9 KiB
Nix
Raw Normal View History

{ lib, buildGoPackage, fetchFromGitHub, go-bindata, installShellFiles }:
let
2016-10-09 18:25:39 +01:00
goPackagePath = "k8s.io/kops";
2020-09-10 09:47:24 +01:00
generic = { version, sha256, rev ? version, ... }@attrs:
let attrs' = builtins.removeAttrs attrs [ "version" "sha256" "rev" ]; in
buildGoPackage
{
2019-08-13 22:52:01 +01:00
pname = "kops";
inherit version;
inherit goPackagePath;
src = fetchFromGitHub {
2020-08-03 09:49:15 +01:00
rev = rev;
owner = "kubernetes";
repo = "kops";
inherit sha256;
};
2020-04-26 04:16:52 +01:00
nativeBuildInputs = [ go-bindata installShellFiles ];
2020-03-18 09:23:22 +00:00
subPackages = [ "cmd/kops" ];
buildFlagsArray = ''
-ldflags=
-X k8s.io/kops.Version=${version}
-X k8s.io/kops.GitVersion=${version}
'';
preBuild = ''
(cd go/src/k8s.io/kops
go-bindata -o upup/models/bindata.go -pkg models -prefix upup/models/ upup/models/...)
'';
postInstall = ''
2020-04-26 04:16:52 +01:00
for shell in bash zsh; do
$out/bin/kops completion $shell > kops.$shell
2020-04-26 04:16:52 +01:00
installShellCompletion kops.$shell
done
'';
meta = with lib; {
description = "Easiest way to get a production Kubernetes up and running";
homepage = "https://github.com/kubernetes/kops";
2020-09-10 09:47:24 +01:00
changelog = "https://github.com/kubernetes/kops/tree/master/docs/releases";
license = licenses.asl20;
maintainers = with maintainers; [ offline zimbatm ];
platforms = platforms.unix;
};
} // attrs';
2020-09-10 09:47:24 +01:00
in
rec {
mkKops = generic;
2020-02-27 09:59:41 +00:00
kops_1_16 = mkKops {
2020-07-06 09:35:27 +01:00
version = "1.16.4";
sha256 = "0qi80hzd5wc8vn3y0wsckd7pq09xcshpzvcr7rl5zd4akxb0wl3f";
2020-02-27 09:59:41 +00:00
};
2020-06-03 07:36:57 +01:00
kops_1_17 = mkKops {
2020-09-10 09:35:48 +01:00
version = "1.17.2";
sha256 = "0fmrzjz163hda6sl1jkl7cmg8fw6mmqb9953048jnhmd3w428xlz";
2020-06-03 07:36:57 +01:00
};
2020-08-03 09:49:15 +01:00
kops_1_18 = mkKops rec {
2020-10-25 22:13:15 +00:00
version = "1.18.2";
sha256 = "17na83j6sfhk69w9ssvicc0xd1904z952ad3zzbpha50lcy6nlhp";
2020-08-03 09:49:15 +01:00
rev = "v${version}";
};
2016-10-09 18:25:39 +01:00
}