nixpkgs-suyu/pkgs/tools/system/bpytop/default.nix

53 lines
1.3 KiB
Nix
Raw Normal View History

2021-04-28 08:49:32 +02:00
{ lib
, stdenv
, python3Packages
, fetchFromGitHub
, makeWrapper
}:
2020-08-03 23:34:19 +02:00
stdenv.mkDerivation rec {
pname = "bpytop";
2021-05-04 12:16:25 +02:00
version = "1.0.65";
2020-08-03 23:34:19 +02:00
src = fetchFromGitHub {
owner = "aristocratos";
repo = pname;
rev = "v${version}";
2021-05-04 12:16:25 +02:00
sha256 = "sha256-sWANeoUbvnrTksqfeIRU4a5XeX7QVzT9+ZT3R5Utp+4=";
2020-08-03 23:34:19 +02:00
};
nativeBuildInputs = [ makeWrapper ];
2021-04-28 08:49:32 +02:00
2020-08-03 23:34:19 +02:00
propagatedBuildInputs = with python3Packages; [ python psutil ];
dontBuild = true;
postPatch = ''
sed -i -e "s#/usr/\[local/\]#$out/#g" \
-e "s#/usr/{td}#$out/#g" \
2020-09-07 11:09:32 +02:00
-e "s#THEME_DIR: str = \"\"#THEME_DIR: str = \"$out/share/bpytop/themes\"#" \
2020-08-03 23:34:19 +02:00
./bpytop.py
'';
installPhase = ''
mkdir -p $out/{bin,libexec,share/bpytop}/
cp -r ./themes $out/share/bpytop/
cp ./bpytop.py $out/libexec/
makeWrapper ${python3Packages.python.interpreter} $out/bin/bpytop \
--add-flags "$out/libexec/bpytop.py" \
--prefix PYTHONPATH : "$PYTHONPATH"
'';
meta = with lib; {
2020-08-03 23:34:19 +02:00
description = "A resource monitor; python port of bashtop";
homepage = src.meta.homepage;
license = licenses.apsl20;
maintainers = with maintainers; [ aw ];
platforms = with platforms; linux ++ freebsd ++ darwin;
# https://github.com/NixOS/nixpkgs/pull/94625#issuecomment-668509399
broken = stdenv.isDarwin;
};
}