about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/filesystems/kdiskmark/default.nix
blob: 200705098409b89471bbc8c025d4874cfe790d5b (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
54
55
{ stdenv
, lib
, wrapQtAppsHook
, qtbase
, qttools
, fio
, cmake
, kauth
, extra-cmake-modules
, fetchFromGitHub
}:
stdenv.mkDerivation rec {
  name = "kdiskmark";
  version = "3.0.0";

  src = fetchFromGitHub {
    owner = "jonmagon";
    repo = "kdiskmark";
    rev = version;
    sha256 = "sha256-fDimH0BX0zxGuOMNLhNbMGMr2pS+qbZhflSpoLFK+Ng=";
  };

  nativeBuildInputs = [ cmake wrapQtAppsHook ];

  buildInputs = [
    qtbase
    qttools
    extra-cmake-modules
    kauth
  ];

  postInstall = ''
    # so that kdiskmark can be used as unpriviledged user even on non-kde
    # (where kauth is not in environment.systemPackages)
    ln -s ${kauth}/share/dbus-1/system.d/org.kde.kf5auth.conf $out/share/dbus-1/system.d/00-kdiskmark-needs-org.kde.kf5auth.conf
  '';

  qtWrapperArgs =
    [ "--prefix" "PATH" ":" (lib.makeBinPath [ fio ]) ];

  meta = with lib; {
    description = "HDD and SSD benchmark tool with a friendly graphical user interface";
    longDescription = ''
      If kdiskmark is not run as root it can rely on polkit to get the necessary
      privileges. In this case you must install it with `environment.systemPackages`
      on NixOS, nix-env will not work.
    '';
    homepage = "https://github.com/JonMagon/KDiskMark";
    maintainers = [ maintainers.symphorien ];
    license = licenses.gpl3Only;
    platforms = platforms.linux;
    mainProgram = "kdiskmark";
  };
}