diff options
-rw-r--r-- | home/noweb/default.nix | 6 | ||||
-rw-r--r-- | pkgs/default.nix | 4 | ||||
-rw-r--r-- | pkgs/yalafi-shell/default.nix | 28 |
3 files changed, 37 insertions, 1 deletions
diff --git a/home/noweb/default.nix b/home/noweb/default.nix index 547efe7..ef67862 100644 --- a/home/noweb/default.nix +++ b/home/noweb/default.nix @@ -1,5 +1,9 @@ {pkgs, ...}: { - home.packages = with pkgs; [noweb texlive.combined.scheme-small]; + home.packages = with pkgs; [ + noweb + texliveFull + yalafi-shell + ]; # Prepend nowebs STY files to the search path. I chose to do it globally, # rather than using `makeWrapper` because I sometimes want to manually invoke diff --git a/pkgs/default.nix b/pkgs/default.nix index 5ab245a..0a7fac8 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -11,6 +11,10 @@ pkgs: { watch-while = pkgs.callPackage ./watch-while {}; + # This is not wrapping the YaLafi python library, just a particular example + # from the repo where they spellcheck LaTex files. + yalafi-shell = pkgs.callPackage ./yalafi-shell {}; + # TODO: These should be contained in the 'vimPlugins' attrset. This turns out # to be non-trivial because this module is both consumed in a flake output # context and an overlay context. diff --git a/pkgs/yalafi-shell/default.nix b/pkgs/yalafi-shell/default.nix new file mode 100644 index 0000000..b8092ba --- /dev/null +++ b/pkgs/yalafi-shell/default.nix @@ -0,0 +1,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 "$@" + '' |