1{
2 lib,
3 testers,
4 stdenv,
5 fetchFromGitHub,
6 cmake,
7 pkg-config,
8 gtk3,
9 ncurses,
10 libcpuid,
11 pciutils,
12 procps,
13 wrapGAppsHook3,
14 nasm,
15 opencl-headers,
16 ocl-icd,
17 vulkan-headers,
18 vulkan-loader,
19 glfw,
20 libXdmcp,
21 pcre,
22 util-linux,
23 libselinux,
24 libsepol,
25 libthai,
26 libdatrie,
27 libxkbcommon,
28 libepoxy,
29 dbus,
30 at-spi2-core,
31 libXtst,
32 gtkmm3,
33}:
34
35# Known issues:
36# - The daemon can't be started from the GUI, because pkexec requires a shell
37# registered in /etc/shells. The nix's bash is not in there when running
38# cpu-x from nixpkgs.
39
40stdenv.mkDerivation (finalAttrs: {
41 pname = "cpu-x";
42 version = "5.3.1";
43
44 src = fetchFromGitHub {
45 owner = "TheTumultuousUnicornOfDarkness";
46 repo = "CPU-X";
47 tag = "v${finalAttrs.version}";
48 hash = "sha256-yrDTvOdMeUw2fxLtNjCZggs9M9P1YKeMxm/dI5MRyYQ=";
49 };
50
51 nativeBuildInputs = [
52 cmake
53 pkg-config
54 wrapGAppsHook3
55 nasm
56 ];
57
58 buildInputs = [
59 gtk3
60 gtkmm3
61 ncurses
62 libcpuid
63 pciutils
64 procps
65 vulkan-headers
66 vulkan-loader
67 glfw
68 opencl-headers
69 ocl-icd
70 libXdmcp
71 pcre
72 util-linux
73 libselinux
74 libsepol
75 libthai
76 libdatrie
77 libxkbcommon
78 libepoxy
79 dbus
80 at-spi2-core
81 libXtst
82 ];
83
84 preFixup = ''
85 gappsWrapperArgs+=(
86 --prefix PATH : ${lib.makeBinPath [ stdenv.cc ]}
87 --prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib
88 )
89 '';
90
91 passthru = {
92 tests = {
93 version = testers.testVersion { package = finalAttrs.finalPackage; };
94 };
95 };
96
97 meta = {
98 description = "Free software that gathers information on CPU, motherboard and more";
99 mainProgram = "cpu-x";
100 homepage = "https://thetumultuousunicornofdarkness.github.io/CPU-X";
101 license = lib.licenses.gpl3Plus;
102 platforms = [ "x86_64-linux" ];
103 maintainers = with lib.maintainers; [ viraptor ];
104 };
105})