summaryrefslogtreecommitdiffstats
path: root/pkgs/tools/filesystems/btrfs-heatmap
diff options
context:
space:
mode:
authorEvils <evils.devils@protonmail.com>2020-05-05 02:09:26 +0200
committerEvils <evils.devils@protonmail.com>2020-07-04 00:22:04 +0200
commite3a752dfabb4d35058941ccd5abd1bb1034511f3 (patch)
treeeaffc8db9d64f0476fb4a7e9c97b84ab15232b72 /pkgs/tools/filesystems/btrfs-heatmap
parentb75f75cd5b683b4c9c1e62c6af34ae33284fe29c (diff)
btrfs-heatmap: init at v8
Diffstat (limited to 'pkgs/tools/filesystems/btrfs-heatmap')
-rw-r--r--pkgs/tools/filesystems/btrfs-heatmap/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/pkgs/tools/filesystems/btrfs-heatmap/default.nix b/pkgs/tools/filesystems/btrfs-heatmap/default.nix
new file mode 100644
index 000000000000..04d74d78cfde
--- /dev/null
+++ b/pkgs/tools/filesystems/btrfs-heatmap/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, lib
+, fetchFromGitHub
+, python3
+, installShellFiles
+, fetchurl
+}:
+
+stdenv.mkDerivation rec {
+ pname = "btrfs-heatmap";
+ version = "8";
+
+ src = fetchFromGitHub {
+ owner = "knorrie";
+ repo = "btrfs-heatmap";
+ rev = "v${version}";
+ sha256 = "035frvk3s7g18y81srssvm550nfq7jylr7w60nvixidxvrc0yrnh";
+ };
+
+ # man page is currently only in the debian branch
+ # https://github.com/knorrie/btrfs-heatmap/issues/11
+ msrc = fetchurl {
+ url = "https://raw.githubusercontent.com/knorrie/btrfs-heatmap/45d844e12d7f5842ebb99e65d7b968a5e1a89066/debian/man/btrfs-heatmap.8";
+ sha256 = "1md7xc426sc8lq4w29gjd6gv7vjqhcwrqqcr6z39kihvi04d5f6q";
+ };
+
+ buildInputs = [ python3 ];
+ nativeBuildInputs = [ python3.pkgs.wrapPython installShellFiles ];
+
+ outputs = [ "out" "man" ];
+
+ installPhase = ''
+ install -Dm 0755 heatmap.py $out/sbin/btrfs-heatmap
+ installManPage ${msrc}
+
+ buildPythonPath ${python3.pkgs.btrfs}
+ patchPythonScript $out/sbin/btrfs-heatmap
+ '';
+
+ 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 ];
+ };
+}