python312Packages.dash-renderer: remove (#369714)
[NixPkgs.git] / pkgs / applications / system / glances / default.nix
blob3085d9920bf9ab19d959da6a824eed3fcdfddc5b
2   stdenv,
3   buildPythonApplication,
4   fetchFromGitHub,
5   isPyPy,
6   lib,
7   defusedxml,
8   packaging,
9   psutil,
10   setuptools,
11   pydantic,
12   nixosTests,
13   # Optional dependencies:
14   fastapi,
15   jinja2,
16   pysnmp,
17   hddtemp,
18   netifaces, # IP module
19   uvicorn,
20   requests,
21   prometheus-client,
24 buildPythonApplication rec {
25   pname = "glances";
26   version = "4.2.1";
27   pyproject = true;
29   disabled = isPyPy;
31   src = fetchFromGitHub {
32     owner = "nicolargo";
33     repo = "glances";
34     tag = "v${version}";
35     hash = "sha256-8Jm6DE3B7OQkaNwX/KwXMNZHUyvPtln8mJYaD6yzJRM=";
36   };
38   build-system = [ setuptools ];
40   # On Darwin this package segfaults due to mismatch of pure and impure
41   # CoreFoundation. This issues was solved for binaries but for interpreted
42   # scripts a workaround below is still required.
43   # Relevant: https://github.com/NixOS/nixpkgs/issues/24693
44   makeWrapperArgs = lib.optionals stdenv.hostPlatform.isDarwin [
45     "--set"
46     "DYLD_FRAMEWORK_PATH"
47     "/System/Library/Frameworks"
48   ];
50   # some tests fail in darwin sandbox
51   doCheck = !stdenv.hostPlatform.isDarwin;
53   checkPhase = ''
54     runHook preCheck
56     python unittest-core.py
58     runHook postCheck
59   '';
61   dependencies = [
62     defusedxml
63     netifaces
64     packaging
65     psutil
66     pysnmp
67     fastapi
68     uvicorn
69     requests
70     jinja2
71     prometheus-client
72   ] ++ lib.optional stdenv.hostPlatform.isLinux hddtemp;
74   passthru.tests = {
75     service = nixosTests.glances;
76   };
78   meta = {
79     homepage = "https://nicolargo.github.io/glances/";
80     description = "Cross-platform curses-based monitoring tool";
81     mainProgram = "glances";
82     changelog = "https://github.com/nicolargo/glances/blob/v${version}/NEWS.rst";
83     license = lib.licenses.lgpl3Only;
84     maintainers = with lib.maintainers; [
85       primeos
86       koral
87     ];
88   };