2022-02-25 19:43:21 +01:00
|
|
|
{ lib
|
|
|
|
, python3
|
|
|
|
, fetchFromGitHub
|
|
|
|
}:
|
|
|
|
|
2023-09-29 11:20:12 +02:00
|
|
|
python3.pkgs.toPythonModule (python3.pkgs.buildPythonApplication rec {
|
2022-02-25 19:43:21 +01:00
|
|
|
pname = "searxng";
|
2024-03-07 16:10:59 +01:00
|
|
|
version = "0-unstable-2024-03-08";
|
2022-02-25 19:43:21 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-02-26 12:27:51 +01:00
|
|
|
owner = "searxng";
|
|
|
|
repo = "searxng";
|
2024-03-07 16:10:59 +01:00
|
|
|
rev = "9c08a0cdddae7ceafbe5e00ce94cf7f1d36c97e0";
|
|
|
|
hash = "sha256-0qlOpJqpOmseIeIafd0NLd2lF5whu18QxmwOua8dKzg=";
|
2022-02-25 19:43:21 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i 's/==.*$//' requirements.txt
|
|
|
|
'';
|
|
|
|
|
2023-07-20 12:41:27 +02:00
|
|
|
preBuild =
|
|
|
|
let
|
2024-02-26 12:27:51 +01:00
|
|
|
versionString = lib.concatStringsSep "." (builtins.tail (lib.splitString "-" (lib.removePrefix "0-" version)));
|
2023-07-20 12:41:27 +02:00
|
|
|
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-02-25 19:43:21 +01:00
|
|
|
|
2022-07-17 19:09:30 +02:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
2022-02-25 19:43:21 +01:00
|
|
|
babel
|
|
|
|
certifi
|
|
|
|
python-dateutil
|
2023-02-14 17:35:01 +01:00
|
|
|
fasttext-predict
|
2022-02-25 19:43:21 +01:00
|
|
|
flask
|
2023-01-19 22:04:35 +01:00
|
|
|
flask-babel
|
2022-02-25 19:43:21 +01:00
|
|
|
brotli
|
|
|
|
jinja2
|
|
|
|
lxml
|
|
|
|
pygments
|
2023-06-28 08:33:53 +02:00
|
|
|
pytomlpp
|
2022-02-25 19:43:21 +01:00
|
|
|
pyyaml
|
|
|
|
redis
|
|
|
|
uvloop
|
|
|
|
setproctitle
|
|
|
|
httpx
|
|
|
|
httpx-socks
|
|
|
|
markdown-it-py
|
2022-07-17 19:09:30 +02:00
|
|
|
] ++ httpx.optional-dependencies.http2
|
|
|
|
++ httpx-socks.optional-dependencies.asyncio;
|
2022-02-25 19:43:21 +01: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-06-28 08:33:53 +02:00
|
|
|
|
|
|
|
# copy config schema for the limiter
|
2024-02-26 12:27:51 +01:00
|
|
|
cp searx/limiter.toml $out/${python3.sitePackages}/searx/limiter.toml
|
2022-02-25 19:43:21 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/searxng/searxng";
|
|
|
|
description = "A fork of Searx, a privacy-respecting, hackable metasearch engine";
|
|
|
|
license = licenses.agpl3Plus;
|
2024-02-29 00:33:07 +01:00
|
|
|
mainProgram = "searxng-run";
|
2023-10-03 20:25:18 +02:00
|
|
|
maintainers = with maintainers; [ SuperSandro2000 _999eagle ];
|
2022-02-25 19:43:21 +01:00
|
|
|
};
|
2023-09-29 11:20:12 +02:00
|
|
|
})
|