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.1";
14
15 src = fetchFromGitHub {
16 owner = "cyring";
17 repo = "CoreFreq";
18 rev = version;
19 hash = "sha256-gdJ3yaE/Q10NV9TTbBUwzlF2wogiXFNy8gA36Fr/S7o=";
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 ] ++ extraFlags;
29
30 preInstall = ''
31 mkdir -p $out/bin
32 '';
33
34 installFlags = [ "PREFIX=$(out)" ];
35
36 meta = {
37 description = "CPU monitoring and tuning software designed for 64-bit processors";
38 homepage = "https://github.com/cyring/CoreFreq";
39 license = lib.licenses.gpl2Only;
40 maintainers = with lib.maintainers; [ mrene ];
41 mainProgram = "corefreq-cli";
42 platforms = [
43 "x86_64-linux"
44 "aarch64-linux"
45 ];
46 };
47}