Files
nixpkgs/pkgs/by-name/li/limitcpu/package.nix
Aliaksandr 9921d05da3 treewide: replace stdenv.is* with stdenv.hostPlatform.is*
Assisted-by: claude-code with claude-opus-4-8
2026-08-12 20:27:00 +02:00

38 lines
801 B
Nix

{
lib,
stdenv,
fetchurl,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "limitcpu";
version = "3.2";
src = fetchurl {
url = "mirror://sourceforge/limitcpu/cpulimit-${finalAttrs.version}.tar.gz";
sha256 = "sha256-Wf/rGjUXr+RZmHFL6EGSYKQ2MvfOwI8LAmwezN/1fPw=";
};
buildFlags = with stdenv.hostPlatform; [
(
if isDarwin then
"osx"
else if isFreeBSD then
"freebsd"
else
"cpulimit"
)
];
installFlags = [ "PREFIX=$(out)" ];
meta = {
homepage = "https://limitcpu.sourceforge.net/";
description = "Tool to throttle the CPU usage of programs";
platforms = with lib.platforms; linux ++ freebsd;
license = lib.licenses.gpl2Only;
maintainers = [ lib.maintainers.rycee ];
mainProgram = "cpulimit";
};
})