From 4a49a23d6ead71be43a94e0e37dbd1c47dc3b1ea Mon Sep 17 00:00:00 2001 From: "Wu, Zhenyu" Date: Thu, 10 Oct 2024 05:55:04 +0800 Subject: [PATCH] :package: Add tmux-rime --- default.nix | 1 + pkgs/tools/misc/tmux-rime/default.nix | 39 +++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 pkgs/tools/misc/tmux-rime/default.nix diff --git a/default.nix b/default.nix index 27cc44e..e26494e 100644 --- a/default.nix +++ b/default.nix @@ -30,6 +30,7 @@ let bash-prompt = callPackage ./pkgs/shells/bash/bash-prompt { }; undollar = callPackage ./pkgs/tools/misc/undollar { }; manpager = callPackage ./pkgs/tools/misc/manpager { }; + tmux-rime = callPackage ./pkgs/tools/misc/tmux-rime { }; lua-prompt-style = callPackage ./pkgs/development/lua-modules/prompt-style { }; luajit-prompt-style = callPackage ./pkgs/development/lua-modules/prompt-style { luaPackages = pkgs.luajitPackages; }; diff --git a/pkgs/tools/misc/tmux-rime/default.nix b/pkgs/tools/misc/tmux-rime/default.nix new file mode 100644 index 0000000..ee18782 --- /dev/null +++ b/pkgs/tools/misc/tmux-rime/default.nix @@ -0,0 +1,39 @@ +{ lib +, stdenv +, xmake +, fetchFromGitHub +, unzip +, glib +, librime +, pkg-config +}: +stdenv.mkDerivation rec { + pname = "tmux-rime"; + version = "0.0.1"; + src = fetchFromGitHub { + owner = "Freed-Wu"; + repo = pname; + rev = version; + fetchSubmodules = false; + sha256 = "sha256-zZ6+sZhJW91/TiF6aR0n44jCj2iEkL+RzdEVTw6G9K8="; + }; + + nativeBuildInputs = [ glib.dev stdenv.cc unzip pkg-config ]; + buildInputs = [ glib librime ]; + + buildPhase = '' + cc -otmux-rime *.c ''$(pkg-config --cflags --libs glib-2.0 rime) + ''; + + installPhase = '' + install -D tmux-rime -t $out/bin + ''; + + meta = with lib; { + homepage = "https://github.com/Freed-Wu/tmux-rime"; + description = "rime for tmux"; + license = licenses.gpl3; + maintainers = with maintainers; [ Freed-Wu ]; + platforms = platforms.unix; + }; +}