about summary refs log tree commit diff
path: root/pkgs/development/tools/dive/default.nix
blob: 299be547ce2756699e1d013730899ec53c768596 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{ lib
, stdenv
, buildGoModule
, fetchFromGitHub
, fetchpatch
, pkg-config
, btrfs-progs
, gpgme
, lvm2
}:

buildGoModule rec {
  pname = "dive";
  version = "0.12.0";

  src = fetchFromGitHub {
    owner = "wagoodman";
    repo = "dive";
    rev = "v${version}";
    hash = "sha256-CuVRFybsn7PVPgz3fz5ghpjOEOsTYTv6uUAgRgFewFw=";
  };

  vendorHash = "sha256-uzzawa/Doo6j/Fh9dJMzGKbpp24UTLAo9VGmuQ80IZE=";

  nativeBuildInputs = [ pkg-config ];

  buildInputs = lib.optionals stdenv.isLinux [ btrfs-progs gpgme lvm2 ];

  patches = [
    (fetchpatch {
      name = "add-scrolling-layers.patch";
      url = "https://github.com/wagoodman/dive/pull/478/commits/b7da0f90880ce5e9d3bc2d0f269aadac6ee63c49.patch";
      hash = "sha256-dYqg5JpWKOzy3hVjIVCHA2vmKCtCgc8W+oHEzuGpyxc=";
    })
    (fetchpatch {
      name = "fix-render-update.patch";
      url = "https://github.com/wagoodman/dive/pull/478/commits/326fb0d8c9094ac068a29fecd4f103783199392c.patch";
      hash = "sha256-NC74MqHVChv/Z5hHX8ds3FI+tC+yyBpXvZKSFG3RyC0=";
    })
  ];


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

  meta = with lib; {
    description = "A tool for exploring each layer in a docker image";
    mainProgram = "dive";
    homepage = "https://github.com/wagoodman/dive";
    changelog = "https://github.com/wagoodman/dive/releases/tag/v${version}";
    license = licenses.mit;
    maintainers = with maintainers; [ SuperSandro2000 ];
  };
}