depot/packages/web-apps/searxng/default.nix

71 lines
1.3 KiB
Nix
Raw Normal View History

{ lib, nixosTests, python3, python3Packages, npins, pins }:
2022-05-24 20:38:07 +03:00
let
pin = pins.searxng;
repo = pin.repository;
in with python3Packages;
2022-05-24 20:38:07 +03:00
toPythonModule (buildPythonApplication rec {
2022-05-24 20:38:07 +03:00
pname = "searxng";
version = "1.0.0pre_${builtins.substring 0 7 pin.revision}";
2022-05-26 22:39:50 +03:00
src = npins.mkSource pins.searxng;
2022-05-24 20:38:07 +03:00
patches = [
# wait for https://github.com/NixOS/nixpkgs/pull/211654
./revert-flask-babel-3.0.0.patch
];
2022-05-24 20:38:07 +03:00
postPatch = ''
2022-12-18 20:35:34 +02:00
sed -i \
-e 's/==.*$//' \
2023-01-09 00:26:40 +02:00
-e 's/fasttext-predict/fasttext/g' \
2022-12-18 20:35:34 +02:00
requirements.txt
cat >searx/version_frozen.py <<EOF
VERSION_STRING="${version}"
VERSION_TAG="${pin.revision}"
GIT_URL="https://github.com/${repo.owner}/${repo.repo}"
GIT_BRANCH="${pin.branch}"
DOCKER_TAG="none"
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
2022-12-18 20:35:34 +02:00
fasttext
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/
'';
})