Files
nixpkgs/pkgs/by-name/ha/hardinfo2/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

170 lines
3.2 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
cmake,
glslang,
pkg-config,
libsForQt5,
makeWrapper,
wrapGAppsHook4,
cups,
gtk3,
json-glib,
lerc,
libdatrie,
libdecor,
libepoxy,
libnghttp2,
libpsl,
libselinux,
libsepol,
libsoup_3,
libsysprof-capture,
libthai,
libxkbcommon,
libXdmcp,
libXtst,
pcre2,
sqlite,
util-linux,
vulkan-headers,
wayland,
# runtime
dmidecode,
gawk,
iperf,
mesa-demos,
sysbench,
udisks,
vulkan-tools,
xdg-utils,
xrandr,
nix-update-script,
printingSupport ? true,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "hardinfo2";
version = "2.2.13";
src = fetchFromGitHub {
owner = "hardinfo2";
repo = "hardinfo2";
tag = "release-${finalAttrs.version}";
hash = "sha256-HRP8xjiwhlNHjW4D8y74Pshpn7bksmN5j4jhfF6KOYo=";
};
patches = [
./remove-update.patch
./default-no-theme.patch
];
# fix absolute path for xdg-open
postPatch = ''
substituteInPlace deps/sysobj_early/gui/uri_handler.c \
--replace-fail /usr/bin/xdg-open "${lib.getExe' xdg-utils "xdg-open"}"
'';
nativeBuildInputs = [
cmake
pkg-config
glslang
wrapGAppsHook4
libsForQt5.wrapQtAppsHook
makeWrapper
];
buildInputs = [
gtk3
json-glib
lerc
libdatrie
libdecor
libepoxy
libnghttp2
libpsl
libselinux
libsepol
libsoup_3
libsysprof-capture
libthai
libxkbcommon
pcre2
sqlite
util-linux
libXdmcp
libXtst
vulkan-headers
wayland
];
hardeningDisable = [ "fortify" ];
cmakeFlags = [
(lib.cmakeFeature "CMAKE_INSTALL_DATAROOTDIR" "${placeholder "out"}/share")
(lib.cmakeFeature "CMAKE_INSTALL_SERVICEDIR" "${placeholder "out"}/lib")
];
dontWrapQtApps = true;
preFixup = ''
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
'';
runtimeDeps = [
# system stats
dmidecode
mesa-demos # glxinfo + vkgears for benchmark
# display info
vulkan-tools # vulkaninfo
xrandr
# additional tooling for benchmarks
# https://github.com/hardinfo2/hardinfo2/blob/release-2.2.13/shell/shell.c#L641-L652
gawk
iperf
sysbench
udisks
];
runtimeLibs = lib.optionals printingSupport [ cups ];
postFixup = ''
wrapProgram $out/bin/hardinfo2 \
--prefix PATH : ${lib.makeBinPath finalAttrs.runtimeDeps} \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath finalAttrs.runtimeLibs}
substituteInPlace $out/lib/systemd/system/hardinfo2.service \
--replace-fail "ExecStart=/usr/bin/hwinfo2_fetch_sysdata" "ExecStart=$out/hwinfo2_fetch_sysdata"
'';
# account for tags having a release- prefix
passthru.updateScript = nix-update-script { extraArgs = [ "--version-regex=release-(.*)" ]; };
meta = {
description = "System information and benchmarks for Linux systems";
homepage = "http://www.hardinfo2.org/";
downloadPage = "https://github.com/hardinfo2/hardinfo2/";
changelog = "https://github.com/hardinfo2/hardinfo2/releases/tag/release-${finalAttrs.version}";
license = with lib.licenses; [
gpl2Plus
gpl3Plus
lgpl2Plus
];
maintainers = with lib.maintainers; [
sigmanificient
jk
];
platforms = lib.platforms.linux;
mainProgram = "hardinfo2";
};
})