nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 88 lines 1.9 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 appstream-glib, 6 autoAddDriverRunpath, 7 cargo, 8 desktop-file-utils, 9 meson, 10 ninja, 11 pkg-config, 12 rustPlatform, 13 rustc, 14 wrapGAppsHook4, 15 glib, 16 gtk4, 17 libadwaita, 18 dmidecode, 19 util-linux, 20 nix-update-script, 21}: 22 23stdenv.mkDerivation (finalAttrs: { 24 pname = "resources"; 25 version = "1.8.0"; 26 27 src = fetchFromGitHub { 28 owner = "nokyan"; 29 repo = "resources"; 30 tag = "v${finalAttrs.version}"; 31 hash = "sha256-z4ZVj/nS4n3oqENSK87YJ8sQRnqK7c4tWzKHUD0Qw2s="; 32 }; 33 34 cargoDeps = rustPlatform.fetchCargoVendor { 35 inherit (finalAttrs) pname version src; 36 hash = "sha256-jHdEiK3nu9mN2A6biHq9Iu4bSniD74hGnKFBTt5xVDM="; 37 }; 38 39 nativeBuildInputs = [ 40 appstream-glib 41 autoAddDriverRunpath 42 desktop-file-utils 43 meson 44 ninja 45 pkg-config 46 wrapGAppsHook4 47 rustPlatform.cargoSetupHook 48 cargo 49 rustc 50 ]; 51 52 buildInputs = [ 53 glib 54 gtk4 55 libadwaita 56 ]; 57 58 postPatch = '' 59 substituteInPlace src/utils/memory.rs \ 60 --replace '"dmidecode"' '"${dmidecode}/bin/dmidecode"' 61 substituteInPlace src/utils/cpu.rs \ 62 --replace '"lscpu"' '"${util-linux}/bin/lscpu"' 63 substituteInPlace src/utils/memory.rs \ 64 --replace '"pkexec"' '"/run/wrappers/bin/pkexec"' 65 ''; 66 67 mesonFlags = [ 68 (lib.mesonOption "profile" "default") 69 ]; 70 71 passthru = { 72 updateScript = nix-update-script { }; 73 }; 74 75 meta = { 76 changelog = "https://github.com/nokyan/resources/releases/tag/v${finalAttrs.version}"; 77 description = "Monitor your system resources and processes"; 78 homepage = "https://github.com/nokyan/resources"; 79 license = lib.licenses.gpl3Only; 80 mainProgram = "resources"; 81 maintainers = with lib.maintainers; [ 82 lukas-heiligenbrunner 83 ewuuwe 84 ]; 85 teams = [ lib.teams.gnome-circle ]; 86 platforms = lib.platforms.linux; 87 }; 88})