···11+{ stdenv
22+, lib
33+, wrapQtAppsHook
44+, qtbase
55+, qttools
66+, fio
77+, cmake
88+, kauth
99+, extra-cmake-modules
1010+, fetchFromGitHub
1111+}:
1212+stdenv.mkDerivation rec {
1313+ name = "kdiskmark";
1414+ version = "2.3.0";
1515+1616+ src = fetchFromGitHub {
1717+ owner = "jonmagon";
1818+ repo = "kdiskmark";
1919+ rev = version;
2020+ sha256 = "sha256-9ufRxEbqwcRs+m/YW8D3+1USCJNZEaOUZRec7gvgmtA=";
2121+ };
2222+2323+ nativeBuildInputs = [ cmake wrapQtAppsHook ];
2424+2525+ buildInputs = [
2626+ qtbase
2727+ qttools
2828+ extra-cmake-modules
2929+ kauth
3030+ ];
3131+3232+ postInstall = ''
3333+ # so that kdiskmark can be used as unpriviledged user even on non-kde
3434+ # (where kauth is not in environment.systemPackages)
3535+ 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
3636+ '';
3737+3838+ qtWrapperArgs =
3939+ [ "--prefix" "PATH" ":" (lib.makeBinPath [ fio ]) ];
4040+4141+ meta = with lib; {
4242+ description = "HDD and SSD benchmark tool with a friendly graphical user interface";
4343+ longDescription = ''
4444+ If kdiskmark is not run as root it can rely on polkit to get the necessary
4545+ privileges. In this case you must install it with `environment.systemPackages`
4646+ on NixOS, nix-env will not work.
4747+ '';
4848+ homepage = "https://github.com/JonMagon/KDiskMark";
4949+ maintainers = [ maintainers.symphorien ];
5050+ license = licenses.gpl3Only;
5151+ platforms = platforms.linux;
5252+ };
5353+}
5454+