diff --git a/pkgs/tools/system/wsysmon/default.nix b/pkgs/tools/system/wsysmon/default.nix new file mode 100644 index 00000000000..96c3cc30587 --- /dev/null +++ b/pkgs/tools/system/wsysmon/default.nix @@ -0,0 +1,53 @@ +{ lib +, stdenv +, fetchFromGitHub +, substituteAll +, cmake +, pkg-config +, gtkmm3 +, gtk3 +, procps +, spdlog +}: + +stdenv.mkDerivation rec { + pname = "wsysmon"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "slyfabi"; + repo = "wsysmon"; + rev = version; + sha256 = "sha256-5kfZT+hm064qXoAzi0RdmUqXi8VaXamlbm+FJOrGh3A="; + }; + + patches = [ + # Prevent CMake from trying to fetch libraries from GitHub + (substituteAll { + src = ./dependencies.patch; + spdlog_src = spdlog.src; + }) + # Add an installPhase + ./install.patch + ]; + + nativeBuildInputs = [ + cmake + pkg-config + ]; + + buildInputs = [ + gtkmm3 + gtk3 + procps + spdlog + ]; + + meta = with lib; { + description = "A windows task manager clone for Linux"; + homepage = "https://github.com/SlyFabi/WSysMon"; + license = [ licenses.mit ]; + platforms = platforms.linux; + maintainers = with maintainers; [ totoroot ]; + }; +} diff --git a/pkgs/tools/system/wsysmon/dependencies.patch b/pkgs/tools/system/wsysmon/dependencies.patch new file mode 100644 index 00000000000..cc0a2fc709e --- /dev/null +++ b/pkgs/tools/system/wsysmon/dependencies.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 31e8048..1eec936 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,8 +7,7 @@ include(FetchContent) + + FetchContent_Declare( + spdlog +- GIT_REPOSITORY https://github.com/gabime/spdlog.git +- GIT_TAG v1.10.0 ++ SOURCE_DIR @spdlog_src@ + ) + FetchContent_MakeAvailable(spdlog) + diff --git a/pkgs/tools/system/wsysmon/install.patch b/pkgs/tools/system/wsysmon/install.patch new file mode 100644 index 00000000000..4b5946a7ab7 --- /dev/null +++ b/pkgs/tools/system/wsysmon/install.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 31e8048..a125b3f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,3 +20,9 @@ include_directories(${GTKMM_INCLUDE_DIRS} ${X11_INCLUDE_DIR}) + + add_executable(WSysMon src/main.cpp src/ui/MainWindow.cpp src/ui/widgets/GraphWidget.cpp src/ui/widgets/PerformanceButton.cpp src/ui/views/ProcessesView.cpp src/ui/views/PerformanceView.cpp src/ui/views/performance/PerformanceCPUView.cpp src/ui/views/performance/PerformanceGPUView.cpp src/ui/views/performance/PerformanceNetworkView.cpp src/ui/views/performance/PerformanceRAMView.cpp src/utils/DispatcherThread.cpp src/utils/UnitConverter.cpp src/utils/X11Utils.cpp src/api/process/ProcessManager.cpp src/api/process/ProcessNode.cpp src/api/linux/ProcessesApi.cpp src/api/linux/GPUApi.cpp src/api/linux/NetworkApi.cpp src/api/linux/SystemInfoApi.cpp src/api/DiskApi.h src/api/linux/DiskApi.cpp src/ui/views/performance/PerformanceDiskView.cpp src/ui/views/performance/PerformanceDiskView.h src/api/linux/gpu/nvml.h src/api/linux/gpu/nvml_hook_funcs.inl src/api/linux/gpu/NvGpuApi.cpp src/api/linux/gpu/NvGpuApi.h src/api/HwMonApi.h src/api/linux/HwMonApi.cpp) + target_link_libraries(WSysMon PRIVATE spdlog::spdlog pthread procps ${CMAKE_DL_LIBS} ${GTKMM_LIBRARIES} ${X11_LIBRARIES}) ++ ++install( ++ TARGETS ++ WSysMon ++ RUNTIME DESTINATION bin ++) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 343176a0d47..8a0a96a1320 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12997,6 +12997,8 @@ with pkgs; wrk2 = callPackage ../tools/networking/wrk2 { }; + wsysmon = callPackage ../tools/system/wsysmon { }; + wuzz = callPackage ../tools/networking/wuzz { }; wv = callPackage ../tools/misc/wv { };