summaryrefslogtreecommitdiff
path: root/pkgs/yalafi-shell/default.nix
blob: b8092bad04b17b48712956923dc904ee10e1dabd (plain)
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
{
  python3,
  fetchFromGitHub,
  writeShellScriptBin,
  languagetool,
}: let
  yalafi = python3.pkgs.buildPythonPackage rec {
    pname = "YaLafi";
    version = "1.4.0";
    pyproject = true;

    src = fetchFromGitHub {
      owner = "torik42";
      repo = pname;
      rev = version;
      hash = "sha256-t+iVko04J4j0ULo7AJFhcf/iNVop91GGrpt/ggpQJZo=";
    };

    nativeBuildInputs = [
      python3.pkgs.setuptools-scm
    ];
  };

  python3-with-yalafi = python3.withPackages (ps: [yalafi]);
in
  writeShellScriptBin "yalafi-shell" ''
    ${python3-with-yalafi.interpreter} -m yalafi.shell --lt-command "${languagetool}"/bin/languagetool-commandline "$@"
  ''