9 python3.pkgs.buildPythonApplication rec {
14 src = fetchFromGitHub {
17 rev = "refs/tags/${version}";
18 hash = "sha256-lvOeYTrvW5MfhuJ3lj9n9TRlvpRwVP2vFeaEeJdqIec=";
22 DJANGO_SETTINGS_MODULE = "khoj.app.settings";
23 postgresqlEnableTCP = 1;
26 nativeBuildInputs = with python3.pkgs; [
31 propagatedBuildInputs = with python3.pkgs; [
57 # rapidocr-onnxruntime
71 nativeCheckInputs = with python3.pkgs; [
80 (postgresql.withPackages (p: with p; [ pgvector ]))
85 export HOME=$(mktemp -d)
88 pythonImportsCheck = [
93 # Tests require network access
94 "test_different_user_data_not_accessed"
95 "test_get_api_config_types"
96 "test_get_configured_types_via_api"
99 "test_image_search_by_filepath"
100 "test_image_search_query_truncated"
102 "test_index_update_with_no_auth_key"
104 "test_notes_search_with_exclude_filter"
105 "test_notes_search_with_include_filter"
106 "test_parse_html_plaintext_file"
107 "test_regenerate_index_with_new_entry"
108 "test_regenerate_with_github_fails_without_pat"
109 "test_regenerate_with_invalid_content_type"
110 "test_regenerate_with_valid_content_type"
111 "test_search_for_user2_returns_empty"
112 "test_search_with_invalid_auth_key"
113 "test_search_with_invalid_content_type"
114 "test_search_with_no_auth_key"
115 "test_search_with_valid_content_type"
116 "test_text_index_same_if_content_unchanged"
117 "test_text_indexer_deletes_embedding_before_regenerate"
119 "test_text_search_setup_batch_processes"
120 "test_update_with_invalid_content_type"
121 "test_user_no_data_returns_empty"
123 # Tests require rapidocr-onnxruntime
124 "test_multi_page_pdf_to_jsonl"
125 "test_single_page_pdf_to_jsonl"
126 "test_ocr_page_pdf_to_jsonl"
129 disabledTestPaths = [
130 # Tests require network access
131 "tests/test_conversation_utils.py"
135 description = "Natural Language Search Assistant for your Org-Mode and Markdown notes, Beancount transactions and Photos";
136 homepage = "https://github.com/debanjum/khoj";
137 changelog = "https://github.com/debanjum/khoj/releases/tag/${version}";
138 license = licenses.agpl3Plus;
139 maintainers = with maintainers; [ dit7ya ];
140 broken = true; # last successful build 2024-01-10