summaryrefslogtreecommitdiff
path: root/derivations/crazydiskinfo/default.nix
blob: 61de33848b215ad9a3d2a01cf557373695595feb (plain)
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
{ lib
, cmake
, fetchFromGitHub
, fetchpatch
, libatasmart
, ncurses5
, stdenv
}:

stdenv.mkDerivation rec {
  pname = "crazydiskinfo";
  version = "1.1.0";

  src = fetchFromGitHub {
    owner = "otakuto";
    repo = pname;
    rev = "refs/tags/${version}";
    sha256 = "sha256-+6ShoaggQ256sLSJDj4d16OipUYX/4JjEwLL5hswjiQ=";
  };

  patches = [
    # Patch to fix build warnings
    (fetchpatch {
      url = "https://github.com/otakuto/crazydiskinfo/compare/1.1.0...8563aa8.diff";
      sha256 = "sha256-z9aOQFsivu6sYgsZBOlnTvqnoR2ro/jyuO/WOimLSXk=";
    })
  ];

  nativeBuildInputs = [ cmake ];
  buildInputs = [ libatasmart ncurses5 ];

  cmakeFlags = [ "-DCMAKE_INSTALL_PREFIX=$(out)" ];

  meta = with lib; {
    description = "CrazyDiskInfo is an interactive TUI S.M.A.R.T viewer for Unix systems";
    homepage = "https://github.com/otakuto/crazydiskinfo";
    mainProgram = "crazy";
    license = licenses.mit;
    maintainers = [ maintainers.tjkeller ];
  };
}