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

35 lines
966 B
Nix
Raw Normal View History

# SPDX-FileCopyrightText: 2023-2024 Simon Bruder <simon@sbruder.de>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
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 = {
# http://languagetool.org/download/ngram-data/
2023-03-01 15:12:17 +01:00
languageModel = "/var/lib/languagetool/ngrams";
# https://fasttext.cc/docs/en/language-identification.html
2023-03-01 15:12:17 +01:00
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" = {
enableACME = true;
forceSSL = true;
2023-03-01 15:12:17 +01:00
locations = {
"/".proxyPass = "http://127.0.0.1:${toString cfg.port}";
};
};
}