default.nix 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. { config, pkgs, ... }:
  2. let
  3. buildBinPackage = options: pkgs.stdenv.mkDerivation {
  4. inherit (options) pname version;
  5. src = pkgs.fetchurl {
  6. inherit (options) url sha256;
  7. };
  8. unpackPhase = if options ? "binPath" then "unpackFile $src" else ":";
  9. installPhase = let
  10. binPath = if options ? "binPath" then options.binPath else "$src";
  11. completionCommands = if options ? hasCompletion then ''
  12. $out/bin/${options.pname} completion bash > $out/share/bash-completion/completions/${options.pname}
  13. $out/bin/${options.pname} completion zsh > $out/share/zsh/site-functions/_${options.pname}
  14. '' else "";
  15. in ''
  16. mkdir -p $out/bin $out/share/bash-completion/completions $out/share/zsh/site-functions
  17. cp ${binPath} $out/bin/${options.pname}
  18. chmod +x $out/bin/${options.pname}
  19. ${completionCommands}
  20. '';
  21. };
  22. argocd = buildBinPackage rec {
  23. pname = "argocd";
  24. version = "1.3.0";
  25. url = "https://github.com/argoproj/argo-cd/releases/download/v${version}/argocd-linux-amd64";
  26. sha256 = "1mspgjipalngbjl9rdi2pyvq3g8nh4w2sq5isz87l7fkj4cy4qvk";
  27. hasCompletion = true;
  28. };
  29. helm = buildBinPackage rec {
  30. pname = "helm";
  31. version = "3.0.0";
  32. url = "https://get.helm.sh/helm-v${version}-linux-amd64.tar.gz";
  33. sha256 = "10e1fdcca263062b1d7b2cb93a924be1ef3dd6c381263d8151dd1a20a3d8c0dc";
  34. binPath = "linux-amd64/helm";
  35. hasCompletion = true;
  36. };
  37. eksctl = buildBinPackage rec {
  38. pname = "eksctl";
  39. version = "0.10.2";
  40. url = "https://github.com/weaveworks/eksctl/releases/download/${version}/eksctl_Linux_amd64.tar.gz";
  41. sha256 = "d3e70cd101ca4756ca9b2fbbeb6edcf580ae4783d80004c8847fa177e7d32e03";
  42. binPath = "eksctl";
  43. hasCompletion = true;
  44. };
  45. k9s = buildBinPackage rec {
  46. pname = "k9s";
  47. version = "0.9.3";
  48. url = "https://github.com/derailed/k9s/releases/download/${version}/k9s_${version}_Linux_x86_64.tar.gz";
  49. sha256 = "af3608517684e59de94573ad123486edd6f392c8c319ddbde6223d3ac2d37bd9";
  50. binPath = "k9s";
  51. };
  52. kustomize = buildBinPackage rec {
  53. pname = "kustomize";
  54. version = "3.2.1";
  55. url = "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v${version}/kustomize_kustomize.v${version}_linux_amd64";
  56. sha256 = "a91b38778945e8a63fe70bc7522703a94c1d572d5dcee245e96647359e1fd04b";
  57. };
  58. kubectl-argo-rollouts = buildBinPackage rec {
  59. pname = "kubectl-argo-rollouts";
  60. version = "0.6.0";
  61. url = "https://github.com/argoproj/argo-rollouts/releases/download/v${version}/kubectl-argo-rollouts-linux-amd64";
  62. sha256 = "1cad7038l2jpmkr1gn8293f3vg4jbypqxilix6qcvfdqkxda602p";
  63. };
  64. velero = buildBinPackage rec {
  65. pname = "velero";
  66. version = "1.2.0";
  67. url = "https://github.com/vmware-tanzu/velero/releases/download/v${version}/velero-v${version}-linux-amd64.tar.gz";
  68. sha256 = "4080a37b487a859b5bba8391e965267cd0fe29cd67fd070b6f695fed45619e2c";
  69. binPath = "velero-v${version}-linux-amd64/velero";
  70. };
  71. in {
  72. environment.systemPackages = with pkgs; [
  73. kubectl
  74. kubectx
  75. kops
  76. argocd
  77. helm
  78. eksctl
  79. k9s
  80. kustomize
  81. kubectl-argo-rollouts
  82. aws-iam-authenticator
  83. velero
  84. ];
  85. }