1{ lib
2, stdenv
3, fetchFromGitHub
4, pciutils
5, pkg-config
6, python3
7}:
8
9stdenv.mkDerivation rec {
10 pname = "x86info";
11 version = "unstable-2021-08-07";
12
13 src = fetchFromGitHub {
14 owner = "kernelslacker";
15 repo = pname;
16 rev = "061ea35ecb0697761b6260998fa2045b8bb0be68";
17 hash = "sha256-/qWioC4dV1bQkU4SiTR8duYqoGIMIH7s8vuAXi75juo=";
18 };
19
20 nativeBuildInputs = [
21 pkg-config
22 python3
23 ];
24
25 buildInputs = [
26 pciutils
27 ];
28
29 postBuild = ''
30 patchShebangs lsmsr/createheader.py
31 make -C lsmsr
32 '';
33
34 installPhase = ''
35 mkdir -p $out/bin
36 cp x86info $out/bin
37 cp lsmsr/lsmsr $out/bin
38 '';
39
40 meta = {
41 description = "Identification utility for the x86 series of processors";
42 longDescription = ''
43 x86info will identify all Intel/AMD/Centaur/Cyrix/VIA CPUs. It leverages
44 the cpuid kernel module where possible. it supports parsing model specific
45 registers (MSRs) via the msr kernel module. it will approximate processor
46 frequency, and identify the cache sizes and layout.
47 '';
48 platforms = [ "i686-linux" "x86_64-linux" ];
49 license = lib.licenses.gpl2;
50 homepage = "https://github.com/kernelslacker/x86info";
51 maintainers = with lib.maintainers; [ jcumming ];
52 };
53}