Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 48 lines 1.1 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 kernel, 6 # See the official readme for a list of optional flags: 7 # https://github.com/cyring/CoreFreq/blob/master/README.md 8 extraFlags ? [ ], 9}: 10 11stdenv.mkDerivation rec { 12 pname = "corefreq"; 13 version = "2.0.7"; 14 15 src = fetchFromGitHub { 16 owner = "cyring"; 17 repo = "CoreFreq"; 18 rev = version; 19 hash = "sha256-k9tw32yG8WGGCY0/5WWvRTBzz+jka7PZ9WU05rwnunI="; 20 }; 21 22 nativeBuildInputs = kernel.moduleBuildDependencies; 23 24 env.NIX_CFLAGS_COMPILE = "-I${src}/${stdenv.hostPlatform.qemuArch}"; 25 makeFlags = [ 26 "KERNELDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" 27 "INSTALL_MOD_PATH=$(out)" 28 ] 29 ++ extraFlags; 30 31 preInstall = '' 32 mkdir -p $out/bin 33 ''; 34 35 installFlags = [ "PREFIX=$(out)" ]; 36 37 meta = { 38 description = "CPU monitoring and tuning software designed for 64-bit processors"; 39 homepage = "https://github.com/cyring/CoreFreq"; 40 license = lib.licenses.gpl2Only; 41 maintainers = with lib.maintainers; [ mrene ]; 42 mainProgram = "corefreq-cli"; 43 platforms = [ 44 "x86_64-linux" 45 "aarch64-linux" 46 ]; 47 }; 48}