Loading nixos/modules/services/misc/docling-serve.nix +18 −3 Original line number Diff line number Diff line Loading @@ -15,6 +15,13 @@ in 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"; Loading @@ -36,11 +43,11 @@ in 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 = '' Loading Loading @@ -77,11 +84,19 @@ in 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"; Loading pkgs/by-name/do/docling-serve/package.nix +6 −2 Original line number Diff line number Diff line { python3Packages, nixosTests }: { python3Packages, nixosTests, withUI ? false, }: (python3Packages.toPythonApplication python3Packages.docling-serve) (python3Packages.toPythonApplication (python3Packages.docling-serve.override { inherit withUI; })) // { passthru.tests = { docling-serve = nixosTests.docling-serve; Loading pkgs/development/python-modules/docling-serve/default.nix +13 −1 Original line number Diff line number Diff line Loading @@ -12,6 +12,10 @@ python-multipart, uvicorn, websockets, gradio, nodejs, which, withUI ? false, }: buildPythonPackage rec { Loading Loading @@ -43,7 +47,15 @@ buildPythonPackage rec { python-multipart uvicorn websockets ] ++ lib.optionals withUI optional-dependencies.ui; optional-dependencies = { ui = [ gradio nodejs which ]; }; pythonImportsCheck = [ "docling_serve" Loading Loading
nixos/modules/services/misc/docling-serve.nix +18 −3 Original line number Diff line number Diff line Loading @@ -15,6 +15,13 @@ in 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"; Loading @@ -36,11 +43,11 @@ in 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 = '' Loading Loading @@ -77,11 +84,19 @@ in 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"; Loading
pkgs/by-name/do/docling-serve/package.nix +6 −2 Original line number Diff line number Diff line { python3Packages, nixosTests }: { python3Packages, nixosTests, withUI ? false, }: (python3Packages.toPythonApplication python3Packages.docling-serve) (python3Packages.toPythonApplication (python3Packages.docling-serve.override { inherit withUI; })) // { passthru.tests = { docling-serve = nixosTests.docling-serve; Loading
pkgs/development/python-modules/docling-serve/default.nix +13 −1 Original line number Diff line number Diff line Loading @@ -12,6 +12,10 @@ python-multipart, uvicorn, websockets, gradio, nodejs, which, withUI ? false, }: buildPythonPackage rec { Loading Loading @@ -43,7 +47,15 @@ buildPythonPackage rec { python-multipart uvicorn websockets ] ++ lib.optionals withUI optional-dependencies.ui; optional-dependencies = { ui = [ gradio nodejs which ]; }; pythonImportsCheck = [ "docling_serve" Loading