commit b51d861ad37ef7cc98f8693bb58e49a63f15beac parent d95a744bfed03f39d6b1bdbf383a5d89fd3d1a03 Author: vin <vin@vineetk.net> Date: Thu, 9 Jan 2025 03:41:26 -0500 add searxng config Diffstat:
| M | hosts/demiurge/default.nix | | | 361 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 361 insertions(+), 0 deletions(-)
diff --git a/hosts/demiurge/default.nix b/hosts/demiurge/default.nix @@ -204,6 +204,367 @@ pulse.enable = true; }; + # searching + searx = { + enable = true; + + settings = { + use_default_settings = false; + general.debug = true; + + search.default_lang = "en"; + + server = { + base_url = "https://searx.demiurge.vpn"; + bind_address = "127.0.0.1"; + port = 8081; + secret_key = "sJ8oFeH9sC+wriftl2DqVaPC0QDoBDBpqrcOw4Ixw1M="; + }; + + ui.theme_args.simple_style = "dark"; + + enabled_plugins = [ + "Hostnames plugin" + "Open Access DOI rewrite" + "Tracker URL remover" + ]; + + hostnames = { + replace = { + "(.*\.)?youtube\.com$" = "invidious.demiurge.vpn"; + "(.*\.)?youtu\.be$" = "invidious.demiurge.vpn"; + "(.*\.)?reddit\.com$" = "redlib.demiurge.vpn"; + "(.*\.)?redd\.it$" = "redlib.demiurge.vpn"; + }; + + remove = [ + "geeksforgeeks.org" + "tutorialpoint.com" + "chegg.com" + "numerade.com" + "study.com" + ]; + }; + + engines = [ + { + name = "arch linux wiki"; + engine = "archlinux"; + shortcut = "al"; + categories = "it"; + } + + { + name = "arxiv"; + engine = "arxiv"; + shortcut = "arx"; + timeout = 4.0; + categories = "science"; + } + + { + name = "wikipedia"; + engine = "wikipedia"; + shortcut = "wp"; + # add "list" to the array to get results in the results list + display_type = "infobox"; + categories = "general"; + } + + { + name = "btdigg"; + engine = "btdigg"; + shortcut = "bt"; + categories = "files"; + } + + { + name = "cppreference"; + engine = "cppreference"; + shortcut = "cpp"; + paging = false; + categories = "it"; + } + + { + name = "free software directory"; + engine = "mediawiki"; + shortcut = "fsd"; + categories = ["it" "software wikis"]; + base_url = "https://directory.fsf.org/"; + search_type = "title"; + timeout = 5.0; + about = { + website = "https://directory.fsf.org/"; + wikidata_id = "Q2470288"; + }; + } + + { + name = "gentoo"; + engine = "mediawiki"; + shortcut = "ge"; + categories = ["it" "software wikis"]; + base_url = "https://wiki.gentoo.org/"; + api_path = "api.php"; + search_type = "text"; + timeout = 10; + } + + { + name = "gitlab"; + engine = "gitlab"; + base_url = "https://gitlab.com"; + shortcut = "gl"; + about = { + website = "https://gitlab.com/"; + wikidata_id = "Q16639197"; + }; + } + + { + name = "github"; + engine = "github"; + shortcut = "gh"; + } + + { + name = "codeberg"; + # https://docs.searxng.org/dev/engines/online/gitea.html + engine = "gitea"; + base_url = "https://codeberg.org"; + shortcut = "cb"; + } + + { + name = "gitea.com"; + engine = "gitea"; + base_url = "https://gitea.com"; + shortcut = "gitea"; + } + + { + name = "google images"; + engine = "google_images"; + shortcut = "goi"; + } + + { + name = "google scholar"; + engine = "google_scholar"; + shortcut = "gos"; + } + + { + name = "invidious"; + engine = "invidious"; + base_url = [ + "https://invidious.demiurge.vpn" + ]; + shortcut = "iv"; + timeout = 3.0; + } + + { + name = "library genesis"; + engine = "xpath"; + search_url = "https://libgen.is/search.php?req={query}"; + url_xpath = "//a[contains(@href,\"book/index.php?md5\")]/@href"; + title_xpath = "//a[contains(@href,\"book/\")]/text()[1]"; + content_xpath = "//td/a[1][contains(@href,\"=author\")]/text()"; + categories = "files"; + timeout = 7.0; + shortcut = "lg"; + about = { + website = "https://libgen.fun/"; + wikidata_id = "Q22017206"; + official_api_documentation = ""; + use_official_api = false; + require_api_key = false; + results = "HTML"; + }; + } + + { + name = "z-library"; + engine = "zlibrary"; + shortcut = "zlib"; + categories = "files"; + timeout = 7.0; + } + + { + name = "nyaa"; + engine = "nyaa"; + shortcut = "nt"; + } + + { + name = "openlibrary"; + engine = "openlibrary"; + shortcut = "ol"; + timeout = 5; + } + + { + name = "stackoverflow"; + engine = "stackexchange"; + shortcut = "st"; + api_site = "stackoverflow"; + categories = ["it" "q&a"]; + } + + { + name = "askubuntu"; + engine = "stackexchange"; + shortcut = "ubuntu"; + api_site = "askubuntu"; + categories = ["it" "q&a"]; + } + + { + name = "superuser"; + engine = "stackexchange"; + shortcut = "su"; + api_site = "superuser"; + categories = ["it" "q&a"]; + } + + { + name = "nixos.discourse"; + engine = "discourse"; + shortcut = "dnos"; + base_url = "https://discourse.nixos.org"; + categories = ["it" "q&a"]; + } + + { + name = "unsplash"; + engine = "unsplash"; + shortcut = "us"; + } + + { + name = "wiby"; + engine = "json_engine"; + paging = true; + weight = 0.5; + search_url = "https://wiby.me/json/?q={query}&p={pageno}"; + url_query = "URL"; + title_query = "Title"; + content_query = "Snippet"; + categories = ["general" "web"]; + shortcut = "wib"; + about.website = "https://wiby.me/"; + } + + { + name = "wikibooks"; + engine = "mediawiki"; + weight = 0.5; + shortcut = "wb"; + categories = ["general" "wikimedia"]; + base_url = "https://{language}.wikibooks.org/"; + search_type = "text"; + about = { + website = "https://www.wikibooks.org/"; + wikidata_id = "Q367"; + }; + } + + { + name = "wiktionary"; + engine = "mediawiki"; + shortcut = "wt"; + categories = ["dictionaries" "wikimedia"]; + base_url = "https://{language}.wiktionary.org/"; + search_type = "text"; + about = { + website = "https://www.wiktionary.org/"; + wikidata_id = "Q151"; + }; + } + + { + name = "wikiversity"; + engine = "mediawiki"; + weight = 0.5; + shortcut = "wv"; + categories = ["general" "wikimedia"]; + base_url = "https://{language}.wikiversity.org/"; + search_type = "text"; + about = { + website = "https://www.wikiversity.org/"; + wikidata_id = "Q370"; + }; + } + + { + name = "peertube"; + engine = "peertube"; + shortcut = "ptb"; + paging = true; + # alternatives see = "https://instances.joinpeertube.org/instances + # base_url = "https://tube.4aem.com + categories = "videos"; + timeout = 6.0; + } + + { + name = "brave"; + engine = "brave"; + shortcut = "br"; + time_range_support = true; + paging = true; + categories = ["general" "web"]; + brave_category = "search"; + } + + { + name = "brave.images"; + engine = "brave"; + network = "brave"; + shortcut = "brimg"; + categories = ["images" "web"]; + brave_category = "images"; + } + + { + name = "sourcehut"; + shortcut = "srht"; + engine = "xpath"; + paging = true; + search_url = "https://sr.ht/projects?page={pageno}&search={query}"; + results_xpath = "(//div[@class=\"event-list\"])[1]/div[@class=\"event\"]"; + url_xpath = "./h4/a[2]/@href"; + title_xpath = "./h4/a[2]"; + content_xpath = "./p"; + first_page_num = 1; + categories = ["it" "repos"]; + about = { + website = "https://sr.ht"; + wikidata_id = "Q78514485"; + official_api_documentation = "https://man.sr.ht/"; + use_official_api = false; + require_api_key = false; + results = "HTML"; + }; + } + ]; + + doi_resolvers = { + "oadoi.org" = "https://oadoi.org/"; + "doi.org" = "https://doi.org/"; + "doai.io" = "https://dissem.in/"; + "sci-hub.se" = "https://sci-hub.se/"; + "sci-hub.st" = "https://sci-hub.st/"; + "sci-hub.ru" = "https://sci-hub.ru/"; + }; + + default_doi_resolver = "sci-hub.st"; + }; + }; + # torrents transmission = { enable = true;