1{
2 buildGoModule,
3 fetchFromGitHub,
4 installShellFiles,
5 lib,
6 stdenv,
7}:
8buildGoModule rec {
9 pname = "devbox";
10 version = "0.15.0";
11
12 src = fetchFromGitHub {
13 owner = "jetify-com";
14 repo = pname;
15 rev = version;
16 hash = "sha256-LAYGjpaHxlolzzpilD3DOvd+J0eNJ0p+VdRayGQvUWo=";
17 };
18
19 ldflags = [
20 "-s"
21 "-w"
22 "-X go.jetify.com/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-cBRdJUviqtzX1W85/rZr23W51mdjoEPCwXxF754Dhqw=";
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.jetify.com/devbox";
44 license = licenses.asl20;
45 maintainers = with maintainers; [
46 urandom
47 lagoja
48 madeddie
49 ];
50 };
51}