nixos-config/machines/fuuko/services/languagetool.nix

27 lines
743 B
Nix
Raw Normal View History

2023-03-01 15:12:17 +01:00
{ config, pkgs, ... }:
let
cfg = config.services.languagetool;
in
{
services.languagetool = {
enable = true;
#allowOrigin = "https://languagetool.sbruder.de";
allowOrigin = "*";
settings = {
languageModel = "/var/lib/languagetool/ngrams";
word2vecModel = "/var/lib/languagetool/word2vec";
fasttextModel = "/var/lib/languagetool/fasttext/lid.176.bin";
fasttextBinary = "${pkgs.fasttext}/bin/fasttext";
};
};
# default log level is INFO, no easy way to reduce it.
#systemd.services.languagetool.serviceConfig.StandardOutput = "null";
services.nginx.virtualHosts."languagetool.sbruder.de" = {
locations = {
"/".proxyPass = "http://127.0.0.1:${toString cfg.port}";
};
};
}