depot/third_party/nixpkgs/pkgs/tools/system/kanata/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

42 lines
1.1 KiB
Nix

{ stdenv
, lib
, darwin
, rustPlatform
, fetchFromGitHub
, withCmd ? false
}:
rustPlatform.buildRustPackage rec {
pname = "kanata";
version = "1.6.1";
src = fetchFromGitHub {
owner = "jtroo";
repo = pname;
rev = "v${version}";
sha256 = "sha256-Kuxy6lGzImYYujuJwZZdfuu3X7/PJNOJefeZ0hVJaAA=";
};
cargoHash =
if stdenv.isLinux
then "sha256-R2lHg+I8Sry3/n8vTfPpDysKCKMDUvxyMKRhEQKDqS0="
else "sha256-9CXrOP6SI+sCD9Q94N8TlRB/h+F/l7t3zHbtVDqddS4=";
buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.IOKit ];
buildFeatures = lib.optional withCmd "cmd";
postInstall = ''
install -Dm 444 assets/kanata-icon.svg $out/share/icons/hicolor/scalable/apps/kanata.svg
'';
meta = with lib; {
description = "Tool to improve keyboard comfort and usability with advanced customization";
homepage = "https://github.com/jtroo/kanata";
license = licenses.lgpl3Only;
maintainers = with maintainers; [ bmanuel linj ];
platforms = platforms.unix;
mainProgram = "kanata";
broken = stdenv.isDarwin;
};
}