1{ lib
2, stdenv
3, buildGoModule
4, fetchFromGitHub
5, fetchpatch
6, pkg-config
7, btrfs-progs
8, gpgme
9, lvm2
10}:
11
12buildGoModule rec {
13 pname = "dive";
14 version = "0.12.0";
15
16 src = fetchFromGitHub {
17 owner = "wagoodman";
18 repo = "dive";
19 rev = "v${version}";
20 hash = "sha256-CuVRFybsn7PVPgz3fz5ghpjOEOsTYTv6uUAgRgFewFw=";
21 };
22
23 vendorHash = "sha256-uzzawa/Doo6j/Fh9dJMzGKbpp24UTLAo9VGmuQ80IZE=";
24
25 nativeBuildInputs = [ pkg-config ];
26
27 buildInputs = lib.optionals stdenv.isLinux [ btrfs-progs gpgme lvm2 ];
28
29 patches = [
30 # fix scrolling
31 # See https://github.com/wagoodman/dive/pull/447
32 (fetchpatch {
33 name = "fix-scrolling.patch";
34 url = "https://github.com/wagoodman/dive/pull/473/commits/a885fa6e68b3763d52de20603ee1b9cd8949276f.patch";
35 hash = "sha256-6gTWfyvK19xDqc7Ah33ewgz/WQRcQHLYwerrwUtRpJc=";
36 })
37 (fetchpatch {
38 name = "add-scrolling-layers.patch";
39 url = "https://github.com/wagoodman/dive/pull/473/commits/840653158e235bdd59b4c4621cf282ce6499c714.patch";
40 hash = "sha256-dYqg5JpWKOzy3hVjIVCHA2vmKCtCgc8W+oHEzuGpyxc=";
41 })
42 (fetchpatch {
43 name = "fix-render-update.patch";
44 url = "https://github.com/wagoodman/dive/pull/473/commits/36177a9154eebe9e3ae9461a9e6f6b368f7974e1.patch";
45 hash = "sha256-rSeEYxUaYlEZGv+NWYK+nATBYS4P2swqjC3HimHyqNI=";
46 })
47 ];
48
49
50 ldflags = [ "-s" "-w" "-X main.version=${version}" ];
51
52 meta = with lib; {
53 description = "Tool for exploring each layer in a docker image";
54 mainProgram = "dive";
55 homepage = "https://github.com/wagoodman/dive";
56 changelog = "https://github.com/wagoodman/dive/releases/tag/v${version}";
57 license = licenses.mit;
58 maintainers = with maintainers; [ SuperSandro2000 ];
59 };
60}