Add systemd service for languagetool

home-manager doesn't provide a systemd service itself.
That's why we build one ourself.

That also revealed a change in our directory structure.
The structure is now documented within readme.
This commit is contained in:
Daniel Siepmann 2022-02-02 18:17:06 +01:00
parent 74d9ba47c7
commit fdbb403bce
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
4 changed files with 46 additions and 1 deletions

View file

@ -43,5 +43,9 @@
pkgs.vlc
];
services.dunst = import ./home/services/dunst.nix;
services.dunst = import ./home/configurations/dunst.nix;
systemd.user.services.languagetool = import ./home/services/languagetool.nix {
inherit pkgs;
};
}

View file

@ -0,0 +1,22 @@
{ pkgs }:
{
Unit = {
Description = "Languagetool Server";
StartLimitBurst = 3;
StartLimitInterval = 400;
};
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 \"*\"";
};
Install = {
WantedBy = ["default.target"];
};
}

View file

@ -31,6 +31,25 @@ Usage
Add packages to ``home.nix`` and run ``home-manager switch``.
Folder structure
----------------
The folder ``overlays`` contains overlays for nix itself.
E.g. alter packages like patching.
The folder ``home`` is related to extras for home-manager.
It has the following sub folder:
``home/configurations``
Holds home-manager configuration for packages / services.
Each file corresponds to a single package.
Each file is loaded within ``home.nix``.
``home/services``
Holds custom definitions for systemd services.
Each file corresponds to a single service.
Each file is loaded within ``home.nix``.
Update
------