2023-08-04 22:07:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitLab
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cargo
|
|
|
|
, libxml2
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, python311
|
|
|
|
, rustPlatform
|
|
|
|
, symlinkJoin
|
|
|
|
, rustc
|
|
|
|
, wrapGAppsHook4
|
|
|
|
, appstream-glib
|
|
|
|
, blueprint-compiler
|
|
|
|
, cairo
|
|
|
|
, cmake
|
2024-01-02 11:29:13 +00:00
|
|
|
, dbus
|
2023-08-04 22:07:22 +00:00
|
|
|
, desktop-file-utils
|
|
|
|
, gdk-pixbuf
|
|
|
|
, gettext
|
|
|
|
, glib
|
|
|
|
, graphene
|
|
|
|
, gtk4
|
2023-11-16 04:20:00 +00:00
|
|
|
, libGL
|
2023-08-04 22:07:22 +00:00
|
|
|
, libadwaita
|
|
|
|
, libdrm
|
|
|
|
, mesa
|
|
|
|
, pango
|
|
|
|
, sqlite
|
|
|
|
, udev
|
|
|
|
, wayland
|
2024-01-02 11:29:13 +00:00
|
|
|
, dmidecode
|
|
|
|
, vulkan-loader
|
2023-08-04 22:07:22 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
nvtop = fetchFromGitHub {
|
|
|
|
owner = "Syllo";
|
|
|
|
repo = "nvtop";
|
2024-01-02 11:29:13 +00:00
|
|
|
rev = "45a1796375cd617d16167869bb88e5e69c809468";
|
|
|
|
hash = "sha256-1P9pWXhgTHogO0DztxOsFKNwvTRRfDL3nzGmMANMC9w=";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mission-center";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.4.3";
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "mission-center-devs";
|
|
|
|
repo = "mission-center";
|
|
|
|
rev = "v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-Yc3oiiD0ernuewq32hk3pDn1vQJNZFgMPPb4lArKP9w=";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = symlinkJoin {
|
|
|
|
name = "cargo-vendor-dir";
|
|
|
|
paths = [
|
|
|
|
(rustPlatform.importCargoLock {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
2024-01-02 11:29:13 +00:00
|
|
|
"pathfinder_canvas-0.5.0" = "sha256-qEp16TVggPtvFvDuUyWsS6rH6MeO6FW0K6BnACghaCg=";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
})
|
|
|
|
(rustPlatform.importCargoLock {
|
2023-10-09 19:29:22 +00:00
|
|
|
lockFile = ./gatherer-Cargo.lock;
|
2023-08-04 22:07:22 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
blueprint-compiler
|
|
|
|
cargo
|
|
|
|
libxml2
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
python311
|
|
|
|
rustPlatform.cargoSetupHook
|
|
|
|
rustc
|
|
|
|
wrapGAppsHook4
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
appstream-glib
|
|
|
|
blueprint-compiler
|
|
|
|
cairo
|
|
|
|
cmake
|
2024-01-02 11:29:13 +00:00
|
|
|
dbus
|
2023-08-04 22:07:22 +00:00
|
|
|
desktop-file-utils
|
|
|
|
gdk-pixbuf
|
|
|
|
gettext
|
|
|
|
glib
|
|
|
|
graphene
|
|
|
|
gtk4
|
2023-11-16 04:20:00 +00:00
|
|
|
libGL
|
2023-08-04 22:07:22 +00:00
|
|
|
libadwaita
|
|
|
|
libdrm
|
|
|
|
mesa
|
|
|
|
pango
|
|
|
|
sqlite
|
|
|
|
udev
|
|
|
|
wayland
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2024-01-02 11:29:13 +00:00
|
|
|
substituteInPlace src/sys_info_v2/gatherer.rs \
|
|
|
|
--replace '"missioncenter-gatherer"' '"${placeholder "out"}/bin/missioncenter-gatherer"'
|
|
|
|
|
|
|
|
substituteInPlace src/sys_info_v2/mem_info.rs \
|
|
|
|
--replace '"dmidecode"' '"${dmidecode}/bin/dmidecode"'
|
|
|
|
|
|
|
|
substituteInPlace $cargoDepsCopy/gl_loader-*/src/glad.c \
|
|
|
|
--replace "libGL.so.1" "${libGL}/lib/libGL.so.1"
|
|
|
|
|
|
|
|
substituteInPlace $cargoDepsCopy/ash-*/src/entry.rs \
|
|
|
|
--replace '"libvulkan.so.1"' '"${vulkan-loader}/lib/libvulkan.so.1"'
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
SRC_GATHERER=$NIX_BUILD_TOP/source/src/sys_info_v2/gatherer
|
|
|
|
SRC_GATHERER_NVTOP=$SRC_GATHERER/3rdparty/nvtop
|
|
|
|
|
|
|
|
substituteInPlace $SRC_GATHERER_NVTOP/nvtop.json \
|
2024-01-02 11:29:13 +00:00
|
|
|
--replace "nvtop-45a1796375cd617d16167869bb88e5e69c809468" "nvtop-src"
|
2023-10-19 13:55:26 +00:00
|
|
|
|
|
|
|
GATHERER_BUILD_DEST=$NIX_BUILD_TOP/source/build/src/sys_info_v2/gatherer/src/debug/build/native
|
|
|
|
mkdir -p $GATHERER_BUILD_DEST
|
|
|
|
NVTOP_SRC=$GATHERER_BUILD_DEST/nvtop-src
|
|
|
|
|
|
|
|
cp -r --no-preserve=mode,ownership "${nvtop}" $NVTOP_SRC
|
|
|
|
pushd $NVTOP_SRC
|
2023-08-04 22:07:22 +00:00
|
|
|
mkdir -p include/libdrm
|
2023-10-19 13:55:26 +00:00
|
|
|
for patchfile in $(ls $SRC_GATHERER_NVTOP/patches/nvtop*.patch); do
|
2023-08-04 22:07:22 +00:00
|
|
|
patch -p1 < $patchfile
|
|
|
|
done
|
2023-10-19 13:55:26 +00:00
|
|
|
popd
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
patchShebangs data/hwdb/generate_hwdb.py
|
2023-10-09 19:29:22 +00:00
|
|
|
'';
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Monitor your CPU, Memory, Disk, Network and GPU usage";
|
|
|
|
homepage = "https://gitlab.com/mission-center-devs/mission-center";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ GaetanLepage ];
|
|
|
|
platforms = platforms.linux;
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "missioncenter";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
}
|