1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
|
{ lib
, stdenv
, fetchFromGitLab
, fetchFromGitHub
, cargo
, libxml2
, meson
, ninja
, pkg-config
, python311
, rustPlatform
, symlinkJoin
, rustc
, wrapGAppsHook4
, appstream-glib
, blueprint-compiler
, cairo
, cmake
, dbus
, desktop-file-utils
, gdk-pixbuf
, gettext
, glib
, graphene
, gtk4
, libGL
, libadwaita
, libdrm
, mesa
, pango
, sqlite
, udev
, wayland
, dmidecode
, vulkan-loader
}:
let
nvtop = fetchFromGitHub {
owner = "Syllo";
repo = "nvtop";
rev = "45a1796375cd617d16167869bb88e5e69c809468";
hash = "sha256-1P9pWXhgTHogO0DztxOsFKNwvTRRfDL3nzGmMANMC9w=";
};
in
stdenv.mkDerivation rec {
pname = "mission-center";
version = "0.4.4";
src = fetchFromGitLab {
owner = "mission-center-devs";
repo = "mission-center";
rev = "v${version}";
hash = "sha256-J0wSu/jWpUJ7Ga6RecY4yLT7i5Ry1HiI+t30SAHOkMw=";
};
cargoDeps = symlinkJoin {
name = "cargo-vendor-dir";
paths = [
(rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
outputHashes = {
"pathfinder_canvas-0.5.0" = "sha256-qEp16TVggPtvFvDuUyWsS6rH6MeO6FW0K6BnACghaCg=";
};
})
(rustPlatform.importCargoLock {
lockFile = ./gatherer-Cargo.lock;
})
];
};
nativeBuildInputs = [
blueprint-compiler
cargo
libxml2
meson
ninja
pkg-config
python311
rustPlatform.cargoSetupHook
rustc
wrapGAppsHook4
];
buildInputs = [
appstream-glib
blueprint-compiler
cairo
cmake
dbus
desktop-file-utils
gdk-pixbuf
gettext
glib
graphene
gtk4
libGL
libadwaita
libdrm
mesa
pango
sqlite
udev
wayland
];
postPatch = ''
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"'
SRC_GATHERER=$NIX_BUILD_TOP/source/src/sys_info_v2/gatherer
SRC_GATHERER_NVTOP=$SRC_GATHERER/3rdparty/nvtop
substituteInPlace $SRC_GATHERER_NVTOP/nvtop.json \
--replace "nvtop-45a1796375cd617d16167869bb88e5e69c809468" "nvtop-src"
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
mkdir -p include/libdrm
for patchfile in $(ls $SRC_GATHERER_NVTOP/patches/nvtop*.patch); do
patch -p1 < $patchfile
done
popd
patchShebangs data/hwdb/generate_hwdb.py
'';
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;
mainProgram = "missioncenter";
};
}
|