2022-07-25 12:58:20 +03:00
|
|
|
{ lib, nixosTests, python3, python3Packages, npins, pins }:
|
2022-05-24 20:38:07 +03:00
|
|
|
|
2023-01-09 00:36:42 +02:00
|
|
|
let
|
|
|
|
pin = pins.searxng;
|
|
|
|
repo = pin.repository;
|
|
|
|
in with python3Packages;
|
2022-05-24 20:38:07 +03:00
|
|
|
|
2023-01-09 00:36:42 +02:00
|
|
|
toPythonModule (buildPythonApplication rec {
|
2022-05-24 20:38:07 +03:00
|
|
|
pname = "searxng";
|
2023-01-09 00:36:42 +02:00
|
|
|
version = "1.0.0pre_${builtins.substring 0 7 pin.revision}";
|
2022-05-26 22:39:50 +03:00
|
|
|
|
2022-07-25 12:58:20 +03:00
|
|
|
src = npins.mkSource pins.searxng;
|
2022-05-24 20:38:07 +03:00
|
|
|
|
|
|
|
postPatch = ''
|
2022-12-18 20:35:34 +02:00
|
|
|
sed -i \
|
|
|
|
-e 's/==.*$//' \
|
|
|
|
requirements.txt
|
2023-01-09 00:36:42 +02:00
|
|
|
cat >searx/version_frozen.py <<EOF
|
|
|
|
VERSION_STRING="${version}"
|
2023-06-06 01:03:47 +03:00
|
|
|
VERSION_TAG="1.0.0"
|
2023-01-09 00:36:42 +02:00
|
|
|
GIT_URL="https://github.com/${repo.owner}/${repo.repo}"
|
|
|
|
GIT_BRANCH="${pin.branch}"
|
2023-01-30 22:37:29 +02:00
|
|
|
DOCKER_TAG="none"
|
2023-01-09 00:36:42 +02:00
|
|
|
EOF
|
2022-05-24 20:38:07 +03:00
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export SEARX_DEBUG="true";
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
Babel
|
|
|
|
certifi
|
|
|
|
python-dateutil
|
|
|
|
flask
|
|
|
|
flaskbabel
|
|
|
|
brotli
|
|
|
|
jinja2
|
|
|
|
langdetect
|
|
|
|
lxml
|
|
|
|
h2
|
|
|
|
pygments
|
|
|
|
pyyaml
|
|
|
|
redis
|
|
|
|
uvloop
|
|
|
|
setproctitle
|
|
|
|
httpx
|
|
|
|
httpx-socks
|
|
|
|
markdown-it-py
|
2023-06-06 01:06:16 +03:00
|
|
|
fasttext-predict
|
2022-12-18 20:35:34 +02:00
|
|
|
pybind11
|
2022-05-24 20:38:07 +03:00
|
|
|
];
|
|
|
|
|
|
|
|
# tests try to connect to network
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "searx" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# Create a symlink for easier access to static data
|
|
|
|
mkdir -p $out/share
|
|
|
|
ln -s ../${python3.sitePackages}/searx/static $out/share/
|
|
|
|
'';
|
|
|
|
})
|