2022-06-03 20:13:28 +02:00
|
|
|
{ lib, stdenv, fetchFromGitHub }:
|
2015-03-28 11:10:39 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "cpulimit";
|
2022-06-03 20:13:28 +02:00
|
|
|
version = "0.2";
|
2015-03-28 11:10:39 +01:00
|
|
|
|
2022-06-03 20:13:28 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "opsengine";
|
|
|
|
repo = "cpulimit";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1dz045yhcsw1rdamzpz4bk8mw888in7fyqk1q1b3m1yk4pd1ahkh";
|
2015-03-28 11:10:39 +01:00
|
|
|
};
|
|
|
|
|
2022-06-03 20:13:28 +02:00
|
|
|
patches = [ ./remove-sys-sysctl.h.patch ./get-missing-basename.patch ];
|
2015-03-28 11:10:39 +01:00
|
|
|
|
2022-06-03 20:13:28 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp src/cpulimit $out/bin
|
|
|
|
'';
|
2015-03-28 11:10:39 +01:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2022-06-03 20:13:28 +02:00
|
|
|
homepage = "https://github.com/opsengine/cpulimit";
|
|
|
|
description = "CPU usage limiter";
|
|
|
|
platforms = platforms.unix;
|
2015-03-28 11:10:39 +01:00
|
|
|
license = licenses.gpl2;
|
2022-06-03 20:13:28 +02:00
|
|
|
maintainers = [ maintainers.jsoo1 ];
|
2015-03-28 11:10:39 +01:00
|
|
|
};
|
|
|
|
}
|