summaryrefslogtreecommitdiff
path: root/config/services/web/searx/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'config/services/web/searx/default.nix')
-rw-r--r--config/services/web/searx/default.nix88
1 files changed, 69 insertions, 19 deletions
diff --git a/config/services/web/searx/default.nix b/config/services/web/searx/default.nix
index 46afcd8..6681366 100644
--- a/config/services/web/searx/default.nix
+++ b/config/services/web/searx/default.nix
@@ -1,37 +1,87 @@
{
config,
lib,
+ pkgs,
...
}:
let
- cfg = {
- searx = config.services.searx;
- filtron = config.services.filtron;
- };
+ cfg = config.services.searx;
in
{
imports = [
- ./searx
- ./filtron
+ ./engines.nix
+ ./limiter.nix
];
- services.nginx.virtualHosts.searx = lib.mkIf (cfg.searx.enable && cfg.filtron.enable) {
- serverName = "searx.${config.networking.domain}";
- locations = {
- "/" = {
- proxyPass = "http://${cfg.filtron.listen.address}:${toString cfg.filtron.listen.port}";
- extraConfig = ''
- proxy_set_header Connection $http_connection;
- proxy_set_header X-Scheme $scheme;
- # proxy_set_header X-Script-Name /;
- '';
- };
- "/static/".alias = "${cfg.searx.package}/share/static/";
+ services.nginx.virtualHosts."searx.aristote.fr" = lib.mkIf (cfg.enable && cfg.configureNginx) {
+ locations."/" = {
+ extraConfig = ''
+ proxy_set_header Host $host;
+ proxy_set_header Connection $http_connection;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Scheme $scheme;
+ # proxy_set_header X-Script-Name /;
+ '';
};
forceSSL = true;
enableACME = true;
};
- systemd.services.uwsgi.personal.monitor = true;
+ services.searx = {
+ enable = true;
+ package = pkgs.searxng;
+
+ configureNginx = true;
+ domain = "searx.aristote.fr";
+
+ configureUwsgi = true;
+ uwsgiConfig = {
+ cache2 = "name=searxcache,items=2000,blocks=2000,blocksize=4096,bitmap=1";
+ };
+
+ environmentFile = "/etc/searx/secrets";
+ settings = {
+ use_default_settings = true;
+ general = {
+ debug = true;
+ contact_url = "mailto:quentin@${config.networking.domain}";
+ enable_stats = false;
+ };
+ search = {
+ autocomplete = "wikipedia";
+ default_lang = "all";
+ formats = [
+ "html"
+ "json"
+ ];
+ };
+ server = {
+ secret_key = "@SECRET_KEY@";
+ image_proxy = true;
+ http_protocol_version = "1.0";
+ method = "GET";
+ };
+ ui = {
+ theme_args = {
+ oscar_style = "pointhi";
+ };
+ };
+ enabled_plugins = [
+ "Open Access DOI rewrite"
+ "Hash plugin"
+ "HTTPS rewrite"
+ "Self Informations"
+ "Search on category select"
+ "Tracker URL remover"
+ "Vim-like hotkeys"
+ ];
+ };
+ };
+
+ systemd.services = {
+ searx-init.personal.monitor = true;
+ uwsgi.personal.monitor = true;
+ };
}