2022-07-14 12:49:19 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "cpulimit";
|
2022-07-14 12:49:19 +00:00
|
|
|
version = "0.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "opsengine";
|
|
|
|
repo = "cpulimit";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1dz045yhcsw1rdamzpz4bk8mw888in7fyqk1q1b3m1yk4pd1ahkh";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
patches = [ ./remove-sys-sysctl.h.patch ./get-missing-basename.patch ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp src/cpulimit $out/bin
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-07-14 12:49:19 +00:00
|
|
|
homepage = "https://github.com/opsengine/cpulimit";
|
|
|
|
description = "CPU usage limiter";
|
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl2;
|
2022-07-14 12:49:19 +00:00
|
|
|
maintainers = [ maintainers.jsoo1 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|