46 # 1) Get the nvtop commit hash (`source-url` in `nvtop.json`):
47 # https://gitlab.com/mission-center-devs/mission-center/-/blob/v<VERSION>/src/sys_info_v2/gatherer/3rdparty/nvtop/nvtop.json?ref_type=tags
48 # 2) Update the version of the main derivation
49 # 3) Get the main `Cargo.lock` and copy it to `Cargo.lock`:
50 # https://gitlab.com/mission-center-devs/mission-center/-/blob/v<VERSION>/Cargo.lock?ref_type=tags
51 # 4) Get the gatherer `Cargo.lock` and copy it to `gatherer-Cargo.lock`:
52 # https://gitlab.com/mission-center-devs/mission-center/-/blob/v<VERSION>/src/sys_info_v2/gatherer/Cargo.lock?ref_type=tags
53 # 5) Refresh both the `nvtop` and `src` hashes
56 nvtop = fetchFromGitHub {
59 rev = "20ea55dbd1eeb4342ff0112fae3ee2a0bfe352ea";
60 hash = "sha256-8lNvxmNAqkmBPFeiYIGtpW0hYXA9N0l4HURew5loj+g=";
63 stdenv.mkDerivation rec {
64 pname = "mission-center";
67 src = fetchFromGitLab {
68 owner = "mission-center-devs";
69 repo = "mission-center";
71 hash = "sha256-PvHIvWyhGovlLaeHk2WMp3yRz4VxvvINzX1oqkFgVuQ=";
74 cargoDeps = symlinkJoin {
75 name = "cargo-vendor-dir";
77 (rustPlatform.importCargoLock { lockFile = ./Cargo.lock; })
78 (rustPlatform.importCargoLock { lockFile = ./gatherer-Cargo.lock; })
90 rustPlatform.cargoSetupHook
118 substituteInPlace src/sys_info_v2/gatherer.rs \
119 --replace-fail '"missioncenter-gatherer"' '"${placeholder "out"}/bin/missioncenter-gatherer"'
121 substituteInPlace $cargoDepsCopy/gl_loader-*/src/glad.c \
122 --replace-fail "libGL.so.1" "${libGL}/lib/libGL.so.1"
124 substituteInPlace $cargoDepsCopy/ash-*/src/entry.rs \
125 --replace-fail '"libvulkan.so.1"' '"${vulkan-loader}/lib/libvulkan.so.1"'
127 SRC_GATHERER=$NIX_BUILD_TOP/source/src/sys_info_v2/gatherer
128 SRC_GATHERER_NVTOP=$SRC_GATHERER/3rdparty/nvtop
130 substituteInPlace $SRC_GATHERER_NVTOP/nvtop.json \
131 --replace-fail "nvtop-${nvtop.rev}" "nvtop-src"
133 GATHERER_BUILD_DEST=$NIX_BUILD_TOP/source/build/src/sys_info_v2/gatherer/src/debug/build/native
134 mkdir -p $GATHERER_BUILD_DEST
135 NVTOP_SRC=$GATHERER_BUILD_DEST/nvtop-src
137 cp -r --no-preserve=mode,ownership "${nvtop}" $NVTOP_SRC
139 mkdir -p include/libdrm
140 for patchfile in $(ls $SRC_GATHERER_NVTOP/patches/nvtop*.patch); do
141 patch -p1 < $patchfile
145 patchShebangs data/hwdb/generate_hwdb.py
148 nativeInstallCheckInputs = [
151 versionCheckProgram = "${builtins.placeholder "out"}/bin/${meta.mainProgram}";
152 doInstallCheck = true;
155 description = "Monitor your CPU, Memory, Disk, Network and GPU usage";
156 homepage = "https://gitlab.com/mission-center-devs/mission-center";
157 changelog = "https://gitlab.com/mission-center-devs/mission-center/-/releases/v${version}";
158 license = lib.licenses.gpl3Only;
159 maintainers = with lib.maintainers; [ GaetanLepage ];
160 platforms = lib.platforms.linux;
161 mainProgram = "missioncenter";