about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/text/hyx/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/text/hyx/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/text/hyx/default.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/text/hyx/default.nix b/nixpkgs/pkgs/tools/text/hyx/default.nix
new file mode 100644
index 000000000000..c287b37dd1b5
--- /dev/null
+++ b/nixpkgs/pkgs/tools/text/hyx/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, memstreamHook }:
+
+stdenv.mkDerivation rec {
+  pname = "hyx";
+  version = "2020-06-09";
+
+  src = fetchurl {
+    url = "https://yx7.cc/code/hyx/hyx-${lib.replaceStrings [ "-" ] [ "." ] version}.tar.xz";
+    sha256 = "1x8dmll93hrnj24kn5knpwj36y6r1v2ygwynpjwrg2hwd4c1a8hi";
+  };
+
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace Makefile \
+      --replace "-Wl,-z,relro,-z,now -fpic -pie" ""
+  '';
+
+  buildInputs = lib.optional (stdenv.system == "x86_64-darwin") memstreamHook;
+
+  installPhase = ''
+    install -vD hyx $out/bin/hyx
+  '';
+
+  meta = with lib; {
+    description = "minimalistic but powerful Linux console hex editor";
+    homepage = "https://yx7.cc/code/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ fpletz ];
+    platforms = with platforms; linux ++ darwin;
+  };
+}