Do not hard code all values, instead configure them within home.nix. This is more for learning purposes. But port and allow might also be changed more frequently in general.
21 lines
444 B
Nix
21 lines
444 B
Nix
{ pkgs, settings }:
|
|
|
|
{
|
|
Unit = {
|
|
Description = "Languagetool Server";
|
|
StartLimitBurst = 3;
|
|
StartLimitInterval = 400;
|
|
};
|
|
|
|
Service = {
|
|
Restart = "on-failure";
|
|
RestartSec = "2s";
|
|
Environment = "JAVA_TOOL_OPTIONS=-Xmx256m";
|
|
ExecStart = "${pkgs.languagetool}/bin/languagetool-http-server --port ${settings.port} --allow-origin ${settings.allow-origin}";
|
|
};
|
|
|
|
Install = {
|
|
WantedBy = ["default.target"];
|
|
};
|
|
}
|