From 7cc979502c3dc5480ef3e4ffe1a05c897084d34b Mon Sep 17 00:00:00 2001 From: Guillaume Girol Date: Fri, 15 Jul 2022 12:00:00 +0000 Subject: [PATCH] kdiskmark: init at 2.3.0 --- pkgs/tools/filesystems/kdiskmark/default.nix | 54 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 56 insertions(+) create mode 100644 pkgs/tools/filesystems/kdiskmark/default.nix diff --git a/pkgs/tools/filesystems/kdiskmark/default.nix b/pkgs/tools/filesystems/kdiskmark/default.nix new file mode 100644 index 000000000000..5975b22df22e --- /dev/null +++ b/pkgs/tools/filesystems/kdiskmark/default.nix @@ -0,0 +1,54 @@ +{ stdenv +, lib +, wrapQtAppsHook +, qtbase +, qttools +, fio +, cmake +, kauth +, extra-cmake-modules +, fetchFromGitHub +}: +stdenv.mkDerivation rec { + name = "kdiskmark"; + version = "2.3.0"; + + src = fetchFromGitHub { + owner = "jonmagon"; + repo = "kdiskmark"; + rev = version; + sha256 = "sha256-9ufRxEbqwcRs+m/YW8D3+1USCJNZEaOUZRec7gvgmtA="; + }; + + 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 = [ lib.licenses.gpl3Only ]; + platforms = lib.platforms.linux; + }; +} + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b91dd161fff4..d0565563525e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7691,6 +7691,8 @@ with pkgs; buildGoModule = buildGo118Module; }; + kdiskmark = libsForQt5.callPackage ../tools/filesystems/kdiskmark { }; + keepalived = callPackage ../tools/networking/keepalived { }; kexec-tools = callPackage ../os-specific/linux/kexec-tools { };