summaryrefslogtreecommitdiffstats
path: root/usecases/server/searx.nix
blob: a0894b4b90622ee792e7a5f3252053c81a050355 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
inputs:

{ config, ... }:

{
  services.searx = {
    enable = true;
    runInUwsgi = true;
    uwsgiConfig = {
      socket = "/run/searx/searx.sock";
      chmod-socket = 666;
      cache2 = "name=searxcache,items=2000,blocks=2000,blocksize=4096,bitmap=1";
    };
    settings = {
      server.secret_key = "@SEARX_SECRET_KEY@";

      ui = {
        default_theme = "oscar";
        theme_args.oscar_style = "logicodev-dark";
      };

      # TODO: setup url here
      # TODO: make this work
      #result_proxy.key = "!!binary \"${config.services.morty.key}\"";
    };
  };

  assertions = [{
    assertion = config.services.searx.environmentFile != null;
    message = "Please define a Searx environment file with your secrets";
  }];

  services.morty = {
    enable = true;
    port = 3002;
  };

  # TODO: setup the reverse proxy here
}