1{
2 buildGoModule,
3 fetchFromGitHub,
4 installShellFiles,
5 lib,
6 stdenv,
7}:
8buildGoModule rec {
9 pname = "devbox";
10 version = "0.13.7";
11
12 src = fetchFromGitHub {
13 owner = "jetpack-io";
14 repo = pname;
15 rev = version;
16 hash = "sha256-D56yT/A3aT9k6uEJv8NYEeHjjKzNiXMveLoOlQSjDKU=";
17 };
18
19 ldflags = [
20 "-s"
21 "-w"
22 "-X go.jetpack.io/devbox/internal/build.Version=${version}"
23 ];
24
25 subPackages = [ "cmd/devbox" ];
26
27 # integration tests want file system access
28 doCheck = false;
29
30 vendorHash = "sha256-xsx+bFjvYpLYE+Sok+4zlsK6i9QLg04fdWQoN5zC2CY=";
31
32 nativeBuildInputs = [ installShellFiles ];
33
34 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
35 installShellCompletion --cmd devbox \
36 --bash <($out/bin/devbox completion bash) \
37 --fish <($out/bin/devbox completion fish) \
38 --zsh <($out/bin/devbox completion zsh)
39 '';
40
41 meta = with lib; {
42 description = "Instant, easy, predictable shells and containers";
43 homepage = "https://www.jetpack.io/devbox";
44 license = licenses.asl20;
45 maintainers = with maintainers; [
46 urandom
47 lagoja
48 ];
49 };
50}