about summary refs log tree commit diff
path: root/pkgs/tools/system/kanata/default.nix
blob: 935d671ab7b782d137f453e09ec620edbfccd7d4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{ stdenv
, lib
, darwin
, rustPlatform
, fetchFromGitHub
, withCmd ? false
}:

rustPlatform.buildRustPackage rec {
  pname = "kanata";
  version = "1.6.0";

  src = fetchFromGitHub {
    owner = "jtroo";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-UZ6WoUZcnqN9k277ikix91UTnqQsUgZW69vbSNNbyHU=";
  };

  cargoHash =
    if stdenv.isLinux
    then "sha256-DLOQnQJtrR7A/elOTVXEnIdLM/FuWYWAPqpbSAXHDMo="
    else "sha256-g6selNjRv9AwkPrzLllJf1VshBvwPhd+lTFIbtSnc3E=";

  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 = "A 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";
  };
}