summary refs log tree commit diff
path: root/pkgs/servers/web-apps/searx/default.nix
blob: 1c5f52d4938ec455ea43adf04da111dcc23acad2 (plain) (blame)
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
{ lib, pythonPackages, fetchFromGitHub }:

pythonPackages.buildPythonApplication rec {
  name = "searx-${version}";
  version = "0.12.0";
  namePrefix = "";

  src = fetchFromGitHub {
    owner = "asciimoo";
    repo = "searx";
    rev = "v${version}";
    sha256 = "196lk8dpv8fsjgmwlqik6j6rabvfid41fir6lzqy03hv7ydcw1k0";
  };

  postPatch = ''
    substituteInPlace requirements.txt \
      --replace 'certifi==2017.1.23' 'certifi' \
      --replace 'lxml==3.7.3' 'lxml' \
      --replace 'pyopenssl==16.2.0' 'pyopenssl' \
      --replace 'pygments==2.1.3' 'pygments>=2.1,<3.0' \
      --replace 'flask==0.12' 'flask==0.12.*' \
      --replace 'requests[socks]==2.13.0' 'requests[socks]==2.*' \
      --replace 'python-dateutil==2.6.0' 'python-dateutil==2.6.*'
  '';

  propagatedBuildInputs = with pythonPackages; [
    pyyaml lxml grequests flaskbabel flask requests
    gevent speaklater Babel pytz dateutil pygments
    pyasn1 pyasn1-modules ndg-httpsclient certifi pysocks
  ];

  meta = with lib; {
    homepage = https://github.com/asciimoo/searx;
    description = "A privacy-respecting, hackable metasearch engine";
    license = licenses.agpl3Plus;
    maintainers = with maintainers; [ matejc fpletz profpatsch ];
  };
}