nixpkgs/pkgs/by-name/re/resources/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

78 lines
1.7 KiB
Nix
Raw Normal View History

2023-11-30 10:28:48 +00:00
{ lib
, stdenv
, fetchFromGitHub
, appstream-glib
, cargo
, desktop-file-utils
, meson
, ninja
, pkg-config
, rustPlatform
, rustc
, wrapGAppsHook4
, glib
, gtk4
, libadwaita
2023-12-10 15:46:28 +00:00
, dmidecode
, util-linux
2023-11-30 10:28:48 +00:00
}:
stdenv.mkDerivation (finalAttrs: {
pname = "resources";
2024-01-05 15:03:19 +00:00
version = "1.3.0";
2023-11-30 10:28:48 +00:00
src = fetchFromGitHub {
owner = "nokyan";
repo = "resources";
rev = "refs/tags/v${finalAttrs.version}";
2024-01-05 15:03:19 +00:00
hash = "sha256-57GsxLxnaQ9o3Dux2fTNWUmhOMs6waYvtV6260CM5fo=";
2023-11-30 10:28:48 +00:00
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit (finalAttrs) src;
name = "resources-${finalAttrs.version}";
2024-01-05 15:03:19 +00:00
hash = "sha256-bHzijXjvbmYltNHevhddz5TCYKg2OMRn+Icb77F18XU=";
2023-11-30 10:28:48 +00:00
};
nativeBuildInputs = [
appstream-glib
desktop-file-utils
meson
ninja
pkg-config
wrapGAppsHook4
rustPlatform.cargoSetupHook
cargo
rustc
];
buildInputs = [
glib
gtk4
libadwaita
];
2023-12-10 15:46:28 +00:00
postPatch = ''
substituteInPlace src/utils/memory.rs \
--replace '"dmidecode"' '"${dmidecode}/bin/dmidecode"'
substituteInPlace src/utils/cpu.rs \
--replace '"lscpu"' '"${util-linux}/bin/lscpu"'
substituteInPlace src/utils/memory.rs \
--replace '"pkexec"' '"/run/wrappers/bin/pkexec"'
'';
2023-11-30 10:28:48 +00:00
mesonFlags = [
(lib.mesonOption "profile" "default")
];
meta = {
changelog = "https://github.com/nokyan/resources/releases/tag/${finalAttrs.version}";
description = "Monitor your system resources and processes";
homepage = "https://github.com/nokyan/resources";
license = lib.licenses.gpl3Only;
mainProgram = "resources";
2023-12-10 15:46:28 +00:00
maintainers = with lib.maintainers; [ lukas-heiligenbrunner ewuuwe ];
2023-11-30 10:28:48 +00:00
platforms = lib.platforms.linux;
};
})