2022-07-18 16:21:45 +00:00
|
|
|
{ lib
|
|
|
|
, python3
|
|
|
|
, fetchFromGitHub
|
|
|
|
}:
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2022-07-18 16:21:45 +00:00
|
|
|
pname = "searxng";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "unstable-2023-07-19";
|
2022-07-18 16:21:45 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
2023-08-04 22:07:22 +00:00
|
|
|
rev = "a446dea1bb492eac417de9a900fae7cdf94aeec0";
|
|
|
|
sha256 = "sha256-iZDaKCkDlp3O3IixWdXVykNRIxas+irG0dWAOU4wycI=";
|
2022-07-18 16:21:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i 's/==.*$//' requirements.txt
|
|
|
|
'';
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
preBuild =
|
|
|
|
let
|
|
|
|
versionString = lib.concatStringsSep "." (builtins.tail (lib.splitString "-" version));
|
|
|
|
commitAbbrev = builtins.substring 0 8 src.rev;
|
|
|
|
in
|
|
|
|
''
|
|
|
|
export SEARX_DEBUG="true";
|
|
|
|
|
|
|
|
cat > searx/version_frozen.py <<EOF
|
|
|
|
VERSION_STRING="${versionString}+${commitAbbrev}"
|
|
|
|
VERSION_TAG="${versionString}+${commitAbbrev}"
|
|
|
|
DOCKER_TAG="${versionString}-${commitAbbrev}"
|
|
|
|
GIT_URL="https://github.com/searxng/searxng"
|
|
|
|
GIT_BRANCH="master"
|
|
|
|
EOF
|
|
|
|
'';
|
2022-07-18 16:21:45 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
2022-07-18 16:21:45 +00:00
|
|
|
babel
|
|
|
|
certifi
|
|
|
|
python-dateutil
|
2023-02-22 10:55:15 +00:00
|
|
|
fasttext-predict
|
2022-07-18 16:21:45 +00:00
|
|
|
flask
|
2023-02-09 11:40:11 +00:00
|
|
|
flask-babel
|
2022-07-18 16:21:45 +00:00
|
|
|
brotli
|
|
|
|
jinja2
|
|
|
|
lxml
|
|
|
|
pygments
|
2023-07-15 17:15:38 +00:00
|
|
|
pytomlpp
|
2022-07-18 16:21:45 +00:00
|
|
|
pyyaml
|
|
|
|
redis
|
|
|
|
uvloop
|
|
|
|
setproctitle
|
|
|
|
httpx
|
|
|
|
httpx-socks
|
|
|
|
markdown-it-py
|
2022-08-12 12:06:08 +00:00
|
|
|
] ++ httpx.optional-dependencies.http2
|
|
|
|
++ httpx-socks.optional-dependencies.asyncio;
|
2022-07-18 16:21:45 +00:00
|
|
|
|
|
|
|
# tests try to connect to network
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# Create a symlink for easier access to static data
|
|
|
|
mkdir -p $out/share
|
|
|
|
ln -s ../${python3.sitePackages}/searx/static $out/share/
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
# copy config schema for the limiter
|
|
|
|
cp searx/botdetection/limiter.toml $out/${python3.sitePackages}/searx/botdetection/limiter.toml
|
2022-07-18 16:21:45 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/searxng/searxng";
|
|
|
|
description = "A fork of Searx, a privacy-respecting, hackable metasearch engine";
|
|
|
|
license = licenses.agpl3Plus;
|
2023-02-22 10:55:15 +00:00
|
|
|
maintainers = with maintainers; [ SuperSandro2000 ];
|
2022-07-18 16:21:45 +00:00
|
|
|
};
|
|
|
|
}
|