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