From b75f75cd5b683b4c9c1e62c6af34ae33284fe29c Mon Sep 17 00:00:00 2001 From: Evils Date: Tue, 5 May 2020 02:08:42 +0200 Subject: [PATCH 1/2] python.pkgs.btrfs: init at v11 --- .../python-modules/btrfs/default.nix | 22 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 pkgs/development/python-modules/btrfs/default.nix diff --git a/pkgs/development/python-modules/btrfs/default.nix b/pkgs/development/python-modules/btrfs/default.nix new file mode 100644 index 000000000000..225b26b4d650 --- /dev/null +++ b/pkgs/development/python-modules/btrfs/default.nix @@ -0,0 +1,22 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +}: + +buildPythonPackage rec { + pname = "btrfs"; + version = "11"; + + src = fetchPypi { + inherit pname version; + sha256 = "1w92sj47wy53ygz725xr613k32pk5khi0g9lrpp6img871241hrx"; + }; + + meta = with stdenv.lib; { + description = "Inspect btrfs filesystems"; + homepage = "https://github.com/knorrie/python-btrfs"; + license = licenses.lgpl3Plus; + platforms = platforms.linux; + maintainers = [ maintainers.evils ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a3db0b8f0c79..4021244995f9 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -557,6 +557,8 @@ in { browsermob-proxy = disabledIf isPy3k (callPackage ../development/python-modules/browsermob-proxy {}); + btrfs = callPackage ../development/python-modules/btrfs { }; + bt_proximity = callPackage ../development/python-modules/bt-proximity { }; bugseverywhere = throw "bugseverywhere has been removed: Abandoned by upstream."; # Added 2019-11-27 From e3a752dfabb4d35058941ccd5abd1bb1034511f3 Mon Sep 17 00:00:00 2001 From: Evils Date: Tue, 5 May 2020 02:09:26 +0200 Subject: [PATCH 2/2] btrfs-heatmap: init at v8 --- .../filesystems/btrfs-heatmap/default.nix | 46 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 48 insertions(+) create mode 100644 pkgs/tools/filesystems/btrfs-heatmap/default.nix 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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2c84e9d8256b..11c1f3aa6f80 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -860,6 +860,8 @@ in boulder = callPackage ../tools/admin/boulder { }; + btrfs-heatmap = callPackage ../tools/filesystems/btrfs-heatmap { }; + buildbot = with python3Packages; toPythonApplication buildbot; buildbot-ui = with python3Packages; toPythonApplication buildbot-ui; buildbot-full = with python3Packages; toPythonApplication buildbot-full;