nixos/docling-serve: update environment variables

Changed files
+18 -3
nixos
modules
services
+18 -3
nixos/modules/services/misc/docling-serve.nix
···
enable = lib.mkEnableOption "Docling Serve server";
package = lib.mkPackageOption pkgs "docling-serve" { };
+
stateDir = lib.mkOption {
+
type = types.path;
+
default = "/var/lib/docling-serve";
+
example = "/home/foo";
+
description = "State directory of Docling Serve.";
+
};
+
host = lib.mkOption {
type = types.str;
default = "127.0.0.1";
···
environment = lib.mkOption {
type = types.attrsOf types.str;
default = {
-
DOCLING_SERVE_ENABLE_UI = "True";
+
DOCLING_SERVE_ENABLE_UI = "False";
};
example = ''
{
-
DOCLING_SERVE_ENABLE_UI = "False";
+
DOCLING_SERVE_ENABLE_UI = "True";
}
'';
description = ''
···
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
-
environment = cfg.environment;
+
environment = {
+
HF_HOME = ".";
+
EASYOCR_MODULE_PATH = ".";
+
MPLCONFIGDIR = ".";
+
} // cfg.environment;
serviceConfig = {
ExecStart = "${lib.getExe cfg.package} run --host \"${cfg.host}\" --port ${toString cfg.port}";
EnvironmentFile = lib.optional (cfg.environmentFile != null) cfg.environmentFile;
+
WorkingDirectory = cfg.stateDir;
+
StateDirectory = "docling-serve";
+
RuntimeDirectory = "docling-serve";
+
RuntimeDirectoryMode = "0755";
PrivateTmp = true;
DynamicUser = true;
DevicePolicy = "closed";