From c66a3bd157632393d65bfeeb1a0eceb8057d7751 Mon Sep 17 00:00:00 2001
From: Gustavo Coutinho de Souza <dev@onemoresuza.mailer.me>
Date: Mon, 24 Jul 2023 18:40:03 -0300
Subject: [PATCH] a4term: init at 0.2.2

---
 pkgs/tools/misc/a4term/default.nix | 34 ++++++++++++++++++++++++++++++
 pkgs/top-level/all-packages.nix    |  2 ++
 2 files changed, 36 insertions(+)
 create mode 100644 pkgs/tools/misc/a4term/default.nix

diff --git a/pkgs/tools/misc/a4term/default.nix b/pkgs/tools/misc/a4term/default.nix
new file mode 100644
index 000000000000..6c9ab7aac249
--- /dev/null
+++ b/pkgs/tools/misc/a4term/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, libtickit
+, libvterm-neovim
+}:
+
+stdenv.mkDerivation rec {
+  pname = "a4term";
+  version = "0.2.2";
+
+  src = fetchFromGitHub {
+    owner = "rpmohn";
+    repo = "a4";
+    rev = "v${version}";
+    hash = "sha256-hsAEiPOZBqjvmSZEmZwfDqHZV/8ym62RZPxl3DG4ntQ=";
+  };
+
+  buildInputs = [
+    libtickit
+    libvterm-neovim
+  ];
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = {
+    description = "A dynamic terminal window manager";
+    homepage = "https://www.a4term.com/";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ onemoresuza ];
+    platforms = lib.platforms.linux;
+    mainProgram = "a4";
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 10a2ff4df8b8..80940acd7645 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -7391,6 +7391,8 @@ with pkgs;
 
   dvtm-unstable = callPackage ../tools/misc/dvtm/unstable.nix { };
 
+  a4term = callPackage ../tools/misc/a4term { };
+
   ecmtools = callPackage ../tools/cd-dvd/ecm-tools { };
 
   erofs-utils = callPackage ../tools/filesystems/erofs-utils { };