summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorfigsoda <figsoda@pm.me>2021-02-16 22:35:52 -0500
committerfigsoda <figsoda@pm.me>2021-02-16 22:35:52 -0500
commit6c80f90e03d3f673fd4a64f10f88598d927ab5b6 (patch)
tree5d0bb45094531206cf513a1c60401420845d911f /pkgs/tools
parent7260e7c1e81358bb2ba415413495b8b738612ac8 (diff)
downloadnixpkgs-6c80f90e03d3f673fd4a64f10f88598d927ab5b6.tar
nixpkgs-6c80f90e03d3f673fd4a64f10f88598d927ab5b6.tar.gz
nixpkgs-6c80f90e03d3f673fd4a64f10f88598d927ab5b6.tar.bz2
nixpkgs-6c80f90e03d3f673fd4a64f10f88598d927ab5b6.tar.lz
nixpkgs-6c80f90e03d3f673fd4a64f10f88598d927ab5b6.tar.xz
nixpkgs-6c80f90e03d3f673fd4a64f10f88598d927ab5b6.tar.zst
nixpkgs-6c80f90e03d3f673fd4a64f10f88598d927ab5b6.zip
xtrt: init at unstable-2021-02-17
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/archivers/xtrt/default.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/pkgs/tools/archivers/xtrt/default.nix b/pkgs/tools/archivers/xtrt/default.nix
new file mode 100644
index 00000000000..175494057e0
--- /dev/null
+++ b/pkgs/tools/archivers/xtrt/default.nix
@@ -0,0 +1,36 @@
+{ bzip2, fetchFromGitHub, gzip, gnutar, lib, stdenv, unzip, xz }:
+
+stdenv.mkDerivation rec {
+  pname = "xtrt";
+  version = "unstable-2021-02-17";
+
+  src = fetchFromGitHub {
+    owner = "figsoda";
+    repo = pname;
+    rev = "61884fb7c48c7e1e2194afd82b85f415a6dc7c20";
+    sha256 = "073l4q6mx5if791p5a6w8m8bz2aypmjmycaijq4spql8bh6h12vf";
+  };
+
+  postPatch = ''
+    substituteInPlace xtrt \
+      --replace "bzip2 " "${bzip2}/bin/bzip2 " \
+      --replace "gzip " "${gzip}/bin/gzip " \
+      --replace "tar " "${gnutar}/bin/tar " \
+      --replace "unzip " "${unzip}/bin/unzip " \
+      --replace "xz " "${xz}/bin/xz "
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/bin
+    cp xtrt $out/bin
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Tiny script to extract archives by their extensions";
+    homepage = "https://github.com/figsoda/xtrt";
+    license = licenses.unlicense;
+    maintainers = with maintainers; [ figsoda ];
+  };
+}