about summary refs log tree commit diff
path: root/pkgs/applications/system/glances/default.nix
blob: 3e387f34a73412328e371ceaacd290d80faeae69 (plain) (blame)
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
{
  stdenv,
  buildPythonApplication,
  fetchFromGitHub,
  isPyPy,
  lib,
  defusedxml,
  future,
  ujson,
  packaging,
  psutil,
  setuptools,
  pydantic,
  # Optional dependencies:
  fastapi,
  jinja2,
  orjson,
  pysnmp,
  hddtemp,
  netifaces, # IP module
  py-cpuinfo,
  uvicorn,
  requests,
  prometheus-client,
}:

buildPythonApplication rec {
  pname = "glances";
  # use unstable to fix a build error for aarch64.
  version = "4.0.8-unstable-2024-06-09";
  disabled = isPyPy;

  src = fetchFromGitHub {
    owner = "nicolargo";
    repo = "glances";
    rev = "051006e12f7c90281dda4af60871b535b0dcdcb9";
    hash = "sha256-iCK5soTACQwtCVMmMsFaqXvZtTKX9WbTul0mUeSWC2M=";
  };

  # On Darwin this package segfaults due to mismatch of pure and impure
  # CoreFoundation. This issues was solved for binaries but for interpreted
  # scripts a workaround below is still required.
  # Relevant: https://github.com/NixOS/nixpkgs/issues/24693
  makeWrapperArgs = lib.optionals stdenv.isDarwin [
    "--set"
    "DYLD_FRAMEWORK_PATH"
    "/System/Library/Frameworks"
  ];

  doCheck = true;
  preCheck = lib.optionalString stdenv.isDarwin ''
    export DYLD_FRAMEWORK_PATH=/System/Library/Frameworks
  '';

  propagatedBuildInputs = [
    defusedxml
    future
    ujson
    netifaces
    packaging
    psutil
    pysnmp
    setuptools
    py-cpuinfo
    pydantic
    fastapi
    uvicorn
    requests
    jinja2
    orjson
    prometheus-client
  ] ++ lib.optional stdenv.isLinux hddtemp;

  meta = {
    homepage = "https://nicolargo.github.io/glances/";
    description = "Cross-platform curses-based monitoring tool";
    mainProgram = "glances";
    changelog = "https://github.com/nicolargo/glances/blob/v${version}/NEWS.rst";
    license = lib.licenses.lgpl3Only;
    maintainers = with lib.maintainers; [
      primeos
      koral
    ];
  };
}