summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorQuentin Aristote <quentin@aristote.fr>2021-10-26 12:29:55 +0200
committerQuentin Aristote <quentin@aristote.fr>2021-10-26 12:29:55 +0200
commit59a363d4f2df16136445d1b63cfc66893251f09b (patch)
tree46d7be9c961ca2f1a329be89c4ea5b19fdfd15fe /config
parent246cc913ec9d4be58361db6ae3ef8895d1396d37 (diff)
restructure engines configuration
Diffstat (limited to 'config')
-rw-r--r--config/services/web/searx/searx/default.nix92
-rw-r--r--config/services/web/searx/searx/engines.nix90
2 files changed, 91 insertions, 91 deletions
diff --git a/config/services/web/searx/searx/default.nix b/config/services/web/searx/searx/default.nix
index ea7f8d5..ec376fd 100644
--- a/config/services/web/searx/searx/default.nix
+++ b/config/services/web/searx/searx/default.nix
@@ -47,97 +47,7 @@ in {
"Tracker URL remover"
"Vim-like hotkeys"
];
- engines = let
- disable = names:
- map (name: {
- inherit name;
- disabled = true;
- }) names;
- in (disable [
- # general
- "bing"
- "currency"
- "dictzone"
- # files
- "btdigg"
- "torrentz"
- # images
- "bing images"
- "ccengine"
- "library of congress"
- "qwant images"
- # it
- "hoogle"
- # map
- "photon"
- ]) ++ [
- {
- name = "emojipedia";
- engine = "xpath";
- search_url = "https://emojipedia.org/search/?q={query}";
- url_xpath = ''//ol[@class="search-results"]/li/h2/a/@href'';
- title_xpath = ''//ol[@class="search-results"]/li/h2/a'';
- content_xpath = ''//ol[@class="search-results"]/li/p'';
- shortcut = "emoji";
- disabled = true;
- about = {
- website = "https://emojipedia.org/";
- wikidata_id = "Q22908129";
- official_api_documentation = "";
- use_official_api = false;
- require_api_key = false;
- results = "HTML";
- };
- }
- {
- name = "alternativeTo";
- engine = "xpath";
- paging = true;
- search_url =
- "https://alternativeto.net/browse/search?q={query}&p={pageno}";
- results_xpath = ''
- //article[@class="row app-list-item"]/div[@class="col-xs-10 col-sm-10 col-md-11 col-lg-offset-1 col-lg-11"]'';
- url_xpath = "./h3/a/@href";
- title_xpath = "./h3/a";
- content_xpath =
- ''./div[@class="itemDesc read-more-box"]/p[@class="text"]'';
- shortcut = "a2";
- categories = "it";
- disabled = true;
- about = {
- website = "https://alternativeto.net";
- wikidata_id = "Q3613175";
- official_api_documentation = "";
- use_official_api = false;
- require_api_key = false;
- results = "HTML";
- };
- }
- {
- name = "duckduckgo";
- disabled = false;
- }
- {
- name = "nLab";
- engine = "xpath";
- search_url = "https://ncatlab.org/nlab/search?query={query}";
- url_xpath = "//li/a/@href";
- title_xpath = "//li/a";
- content_xpath = "//li/a";
- shortcut = "nlab";
- timeout = 10.0;
- categories = "science";
- disabled = true;
- about = {
- website = "https://ncatlab.org/";
- wikidata_id = "Q6954693";
- official_api_documentation = "";
- use_official_api = false;
- require_api_key = false;
- results = "HTML";
- };
- }
- ];
+ engines = ./engines.nix;
};
};
}
diff --git a/config/services/web/searx/searx/engines.nix b/config/services/web/searx/searx/engines.nix
new file mode 100644
index 0000000..a35d4ac
--- /dev/null
+++ b/config/services/web/searx/searx/engines.nix
@@ -0,0 +1,90 @@
+let
+ overrideDisabled = value: names:
+ map (name: {
+ inherit name;
+ disabled = value;
+ }) names;
+ enable = overrideDisabled false;
+ disable = overrideDisabled true;
+in (disable [
+ # general
+ "bing"
+ "currency"
+ "dictzone"
+ # files
+ "btdigg"
+ "torrentz"
+ # images
+ "bing images"
+ "ccengine"
+ "library of congress"
+ "qwant images"
+ # it
+ "hoogle"
+ # map
+ "photon"
+]) ++ (enable [
+ # General
+ "duckduckgo"
+]) ++ [
+ { # AlternativeTo
+ name = "alternativeTo";
+ engine = "xpath";
+ paging = true;
+ search_url = "https://alternativeto.net/browse/search?q={query}&p={pageno}";
+ results_xpath = ''
+ //article[@class="row app-list-item"]/div[@class="col-xs-10 col-sm-10 col-md-11 col-lg-offset-1 col-lg-11"]'';
+ url_xpath = "./h3/a/@href";
+ title_xpath = "./h3/a";
+ content_xpath = ''./div[@class="itemDesc read-more-box"]/p[@class="text"]'';
+ shortcut = "a2";
+ categories = "it";
+ disabled = true;
+ about = {
+ website = "https://alternativeto.net";
+ wikidata_id = "Q3613175";
+ official_api_documentation = "";
+ use_official_api = false;
+ require_api_key = false;
+ results = "HTML";
+ };
+ }
+ { # Emojipedia
+ name = "emojipedia";
+ engine = "xpath";
+ search_url = "https://emojipedia.org/search/?q={query}";
+ url_xpath = ''//ol[@class="search-results"]/li/h2/a/@href'';
+ title_xpath = ''//ol[@class="search-results"]/li/h2/a'';
+ content_xpath = ''//ol[@class="search-results"]/li/p'';
+ shortcut = "emoji";
+ disabled = true;
+ about = {
+ website = "https://emojipedia.org/";
+ wikidata_id = "Q22908129";
+ official_api_documentation = "";
+ use_official_api = false;
+ require_api_key = false;
+ results = "HTML";
+ };
+ }
+ {
+ name = "nLab";
+ engine = "xpath";
+ search_url = "https://ncatlab.org/nlab/search?query={query}";
+ url_xpath = "//li/a/@href";
+ title_xpath = "//li/a";
+ content_xpath = "//li/a";
+ shortcut = "nlab";
+ timeout = 10.0;
+ categories = "science";
+ disabled = true;
+ about = {
+ website = "https://ncatlab.org/";
+ wikidata_id = "Q6954693";
+ official_api_documentation = "";
+ use_official_api = false;
+ require_api_key = false;
+ results = "HTML";
+ };
+ }
+]