about summary refs log tree commit diff
path: root/pkgs/development/tools/build-managers/bob/default.nix
blob: 6821dc19116fba318ee9f759102679eb19d24b37 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:

buildGoModule rec {
  pname = "bob";
  version = "0.8.2";

  src = fetchFromGitHub {
    owner = "benchkram";
    repo = pname;
    rev = version;
    hash = "sha256-zmWfOLBb+GWw9v6LdCC7/WaP1Wz7UipPwqkmI1+rG8Q=";
  };

  ldflags = [ "-s" "-w" "-X main.Version=${version}" ];

  vendorHash = "sha256-S1XUgjdSVTWXehOLCxXcvj0SH12cxqvYadVlCw/saF4=";

  excludedPackages = [ "example/server-db" "test/e2e" "tui-example" ];

  nativeBuildInputs = [ installShellFiles ];

  postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
    installShellCompletion --cmd bob \
      --bash <($out/bin/bob completion) \
      --zsh <($out/bin/bob completion -z)
  '';

  # tests require network access
  doCheck = false;

  meta = with lib; {
    description = "A build system for microservices";
    mainProgram = "bob";
    homepage = "https://bob.build";
    license = licenses.asl20;
    maintainers = with maintainers; [ zuzuleinen ];
  };
}