2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2021-01-05 17:05:55 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, python3
|
|
|
|
, which
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "fatrace";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "0.17.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "martinpitt";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-11-21 17:40:18 +00:00
|
|
|
sha256 = "sha256-MRHM+hyuRevK4L3u6dGw1S3O7w+BJBsprJVcSz6Q9xg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ python3 which ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace power-usage-report \
|
|
|
|
--replace "'which'" "'${which}/bin/which'"
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Report system-wide file access events";
|
2021-01-05 17:05:55 +00:00
|
|
|
homepage = "https://github.com/martinpitt/fatrace";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
longDescription = ''
|
|
|
|
fatrace reports file access events from all running processes.
|
|
|
|
Its main purpose is to find processes which keep waking up the disk
|
|
|
|
unnecessarily and thus prevent some power saving.
|
|
|
|
Requires a Linux kernel with the FANOTIFY configuration option enabled.
|
|
|
|
Enabling X86_MSR is also recommended for power-usage-report on x86.
|
|
|
|
'';
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|