nixpkgs-suyu/pkgs/tools/filesystems/btrfs-heatmap/default.nix

43 lines
955 B
Nix
Raw Normal View History

2020-05-05 02:09:26 +02:00
{ stdenv, lib
, fetchFromGitHub
, python3
, installShellFiles
}:
stdenv.mkDerivation rec {
pname = "btrfs-heatmap";
2021-04-17 22:50:04 +02:00
version = "9";
2020-05-05 02:09:26 +02:00
src = fetchFromGitHub {
owner = "knorrie";
repo = "btrfs-heatmap";
rev = "v${version}";
2021-04-17 22:50:04 +02:00
sha256 = "sha256-yCkuZqWwxrs2eS7EXY6pAOVVVSq7dAMxJtf581gX8vg=";
2020-05-05 02:09:26 +02:00
};
buildInputs = [ python3 ];
nativeBuildInputs = [ python3.pkgs.wrapPython installShellFiles ];
outputs = [ "out" "man" ];
installPhase = ''
2021-04-17 22:50:04 +02:00
runHook preInstall
install -Dm 0755 btrfs-heatmap $out/sbin/btrfs-heatmap
installManPage man/btrfs-heatmap.1
2020-05-05 02:09:26 +02:00
buildPythonPath ${python3.pkgs.btrfs}
patchPythonScript $out/sbin/btrfs-heatmap
2021-04-17 22:50:04 +02:00
runHook postInstall
2020-05-05 02:09:26 +02: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 ];
};
}