From 58893dc7e136465be25bc2551a2359603cb677fa Mon Sep 17 00:00:00 2001 From: Lorenzo Manacorda Date: Sat, 26 Oct 2024 16:46:41 +0200 Subject: [PATCH] btrfs-list: init at 2.3 --- pkgs/by-name/bt/btrfs-list/package.nix | 47 ++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 pkgs/by-name/bt/btrfs-list/package.nix diff --git a/pkgs/by-name/bt/btrfs-list/package.nix b/pkgs/by-name/bt/btrfs-list/package.nix new file mode 100644 index 000000000000..cbe4f01a4423 --- /dev/null +++ b/pkgs/by-name/bt/btrfs-list/package.nix @@ -0,0 +1,47 @@ +{ + lib, + stdenv, + fetchFromGitHub, + makeWrapper, + btrfs-progs, + coreutils, + ncurses, + perl, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "btrfs-list"; + version = "2.3"; + + src = fetchFromGitHub { + owner = "speed47"; + repo = "btrfs-list"; + rev = "v${finalAttrs.version}"; + hash = "sha256-cWzDRop0cyrjVIJzuZxTqELgec66GiPAUJY1xIBr3OY="; + }; + + buildInputs = [ perl ]; + + nativeBuildInputs = [ makeWrapper ]; + + installPhase = '' + install -D -t $out/bin btrfs-list + + wrapProgram $out/bin/btrfs-list \ + --prefix PATH : ${ + lib.makeBinPath [ + coreutils # uses readlink + ncurses # uses tput + btrfs-progs + ] + } + ''; + + meta = { + description = "Get a nice tree-style view of your btrfs subvolumes/snapshots, including their size, à la 'zfs list'"; + homepage = "https://github.com/speed47/btrfs-list"; + license = lib.licenses.gpl2Only; + maintainers = with lib.maintainers; [ asymmetric ]; + mainProgram = "btrfs-list"; + platforms = lib.platforms.linux; + }; +})