Make languageserver service configurable
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.
This commit is contained in:
parent
5b74f60eaf
commit
a02f8c3341
4
home.nix
4
home.nix
|
@ -47,6 +47,10 @@
|
|||
services.dunst = import ./home/configurations/dunst.nix;
|
||||
|
||||
systemd.user.services.languagetool = import ./home/services/languagetool.nix {
|
||||
settings = {
|
||||
port = "8081";
|
||||
allow-origin = "*";
|
||||
};
|
||||
inherit pkgs;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs }:
|
||||
{ pkgs, settings }:
|
||||
|
||||
{
|
||||
Unit = {
|
||||
|
@ -10,10 +10,8 @@
|
|||
Service = {
|
||||
Restart = "on-failure";
|
||||
RestartSec = "2s";
|
||||
# TODO: Make memory optional and configurable
|
||||
Environment = "JAVA_TOOL_OPTIONS=-Xmx256m";
|
||||
# TODO: Make port and allow optional and configurable
|
||||
ExecStart = "${pkgs.languagetool}/bin/languagetool-http-server --port 8081 --allow-origin \"*\"";
|
||||
ExecStart = "${pkgs.languagetool}/bin/languagetool-http-server --port ${settings.port} --allow-origin ${settings.allow-origin}";
|
||||
};
|
||||
|
||||
Install = {
|
||||
|
|
Loading…
Reference in a new issue