about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/system/gnome-resources/default.nix
blob: 4a6bdbcf95dea3d10c0b2f4477559505935144bb (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
{ fetchFromGitHub
, stdenv
, lib
, appstream-glib
, cargo
, desktop-file-utils
, meson
, pkg-config
, rustPlatform
, rustc
, glib
, wrapGAppsHook4
, systemd
, polkit
, dmidecode
, gtk4
, libadwaita
, ninja
}:
stdenv.mkDerivation rec {
  pname = "gnome-resources";
  version = "1.2.1";

  src = fetchFromGitHub {
    owner = "nokyan";
    repo = "resources";
    rev = "v${version}";
    hash = "sha256-OVz1vsmOtH/5sEuyl2BfDqG2/9D1HGtHA0FtPntKQT0=";
  };

  cargoDeps = rustPlatform.fetchCargoTarball {
    inherit src;
    hash = "sha256-SkCEA9CKqzy0wSIUj0DG6asIysD7G9i3nJ9jwhwAUqY=";
  };

  nativeBuildInputs = [
    pkg-config
    desktop-file-utils
    appstream-glib
    meson
    ninja
    rustc
    cargo
    rustPlatform.cargoSetupHook
    wrapGAppsHook4
  ];

  buildInputs = [
    glib
    gtk4
    libadwaita
    polkit
    systemd
  ];

  postPatch = ''
    substituteInPlace src/utils/memory.rs \
      --replace '"dmidecode"' '"${dmidecode}/bin/dmidecode"'
  '';

  mesonFlags = [ "-Dprofile=default" ];

  meta = with lib; {
    homepage = "https://github.com/nokyan/resources";
    description = "Monitor your system resources and processes";
    license = licenses.gpl3Plus;
    mainProgram = "resources";
    maintainers = with maintainers; [ ewuuwe ];
    platforms = platforms.linux;
  };
}