2020-05-05 01:09:26 +01:00
|
|
|
{ stdenv, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, python3
|
|
|
|
, installShellFiles
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "btrfs-heatmap";
|
2021-04-17 21:50:04 +01:00
|
|
|
version = "9";
|
2020-05-05 01:09:26 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "knorrie";
|
|
|
|
repo = "btrfs-heatmap";
|
|
|
|
rev = "v${version}";
|
2021-04-17 21:50:04 +01:00
|
|
|
sha256 = "sha256-yCkuZqWwxrs2eS7EXY6pAOVVVSq7dAMxJtf581gX8vg=";
|
2020-05-05 01:09:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ python3 ];
|
|
|
|
nativeBuildInputs = [ python3.pkgs.wrapPython installShellFiles ];
|
|
|
|
|
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-04-17 21:50:04 +01:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm 0755 btrfs-heatmap $out/sbin/btrfs-heatmap
|
|
|
|
installManPage man/btrfs-heatmap.1
|
2020-05-05 01:09:26 +01:00
|
|
|
|
|
|
|
buildPythonPath ${python3.pkgs.btrfs}
|
|
|
|
patchPythonScript $out/sbin/btrfs-heatmap
|
2021-04-17 21:50:04 +01:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-05-05 01:09:26 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Visualize the layout of a mounted btrfs";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "btrfs-heatmap";
|
2020-05-05 01:09:26 +01:00
|
|
|
homepage = "https://github.com/knorrie/btrfs-heatmap";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.evils ];
|
|
|
|
};
|
|
|
|
}
|