git-nomad: 0.7.1 -> 0.8.0 (#365279)
[NixPkgs.git] / pkgs / applications / networking / cluster / minikube / default.nix
blob438fb2cfde4909335e754baac7a473e354b3e2d9
2   lib,
3   stdenv,
4   buildGoModule,
5   fetchFromGitHub,
6   installShellFiles,
7   pkg-config,
8   which,
9   libvirt,
10   vmnet,
11   withQemu ? false,
12   qemu,
13   makeWrapper,
14   OVMF,
17 buildGoModule rec {
18   pname = "minikube";
19   version = "1.34.0";
21   vendorHash = "sha256-gw5Ol7Gp26KyIaiMvwik8FJpABpMT86vpFnZnAJ6hhs=";
23   doCheck = false;
25   src = fetchFromGitHub {
26     owner = "kubernetes";
27     repo = "minikube";
28     rev = "v${version}";
29     sha256 = "sha256-Z7x3MOQUF3a19X4SSiIUfSJ3xl3482eKH700m/9pqcU=";
30   };
31   postPatch =
32     (lib.optionalString (withQemu && stdenv.hostPlatform.isDarwin) ''
33       substituteInPlace \
34         pkg/minikube/registry/drvs/qemu2/qemu2.go \
35         --replace "/usr/local/opt/qemu/share/qemu" "${qemu}/share/qemu" \
36         --replace "/opt/homebrew/opt/qemu/share/qemu" "${qemu}/share/qemu"
37     '')
38     + (lib.optionalString (withQemu && stdenv.hostPlatform.isLinux) ''
39       substituteInPlace \
40         pkg/minikube/registry/drvs/qemu2/qemu2.go \
41         --replace "/usr/share/OVMF/OVMF_CODE.fd" "${OVMF.firmware}" \
42         --replace "/usr/share/AAVMF/AAVMF_CODE.fd" "${OVMF.firmware}"
43     '');
45   nativeBuildInputs = [
46     installShellFiles
47     pkg-config
48     which
49     makeWrapper
50   ];
52   buildInputs =
53     if stdenv.hostPlatform.isDarwin then
54       [ vmnet ]
55     else if stdenv.hostPlatform.isLinux then
56       [ libvirt ]
57     else
58       null;
60   buildPhase = ''
61     make COMMIT=${src.rev}
62   '';
64   installPhase = ''
65     install out/minikube -Dt $out/bin
67     wrapProgram $out/bin/minikube --set MINIKUBE_WANTUPDATENOTIFICATION false
68     export HOME=$PWD
70     for shell in bash zsh fish; do
71       $out/bin/minikube completion $shell > minikube.$shell
72       installShellCompletion minikube.$shell
73     done
74   '';
76   meta = with lib; {
77     homepage = "https://minikube.sigs.k8s.io";
78     description = "Tool that makes it easy to run Kubernetes locally";
79     mainProgram = "minikube";
80     license = licenses.asl20;
81     maintainers = with maintainers; [
82       ebzzry
83       copumpkin
84       vdemeester
85       atkinschang
86       Chili-Man
87     ];
88   };