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:
parent
74d9ba47c7
commit
fdbb403bce
6
home.nix
6
home.nix
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
|
22
home/services/languagetool.nix
Normal file
22
home/services/languagetool.nix
Normal 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"];
|
||||
};
|
||||
}
|
19
readme.rst
19
readme.rst
|
@ -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
|
||||
------
|
||||
|
||||
|
|
Loading…
Reference in a new issue