1{ stdenv
2, lib
3, wrapQtAppsHook
4, qtbase
5, qttools
6, fio
7, cmake
8, kauth
9, extra-cmake-modules
10, fetchFromGitHub
11}:
12stdenv.mkDerivation rec {
13 name = "kdiskmark";
14 version = "3.0.0";
15
16 src = fetchFromGitHub {
17 owner = "jonmagon";
18 repo = "kdiskmark";
19 rev = version;
20 sha256 = "sha256-fDimH0BX0zxGuOMNLhNbMGMr2pS+qbZhflSpoLFK+Ng=";
21 };
22
23 nativeBuildInputs = [ cmake wrapQtAppsHook ];
24
25 buildInputs = [
26 qtbase
27 qttools
28 extra-cmake-modules
29 kauth
30 ];
31
32 postInstall = ''
33 # so that kdiskmark can be used as unpriviledged user even on non-kde
34 # (where kauth is not in environment.systemPackages)
35 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
36 '';
37
38 qtWrapperArgs =
39 [ "--prefix" "PATH" ":" (lib.makeBinPath [ fio ]) ];
40
41 meta = with lib; {
42 description = "HDD and SSD benchmark tool with a friendly graphical user interface";
43 longDescription = ''
44 If kdiskmark is not run as root it can rely on polkit to get the necessary
45 privileges. In this case you must install it with `environment.systemPackages`
46 on NixOS, nix-env will not work.
47 '';
48 homepage = "https://github.com/JonMagon/KDiskMark";
49 maintainers = [ maintainers.symphorien ];
50 license = licenses.gpl3Only;
51 platforms = platforms.linux;
52 };
53}
54