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

67 lines
1.2 KiB
Nix
Raw Permalink 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
postPatch = ''
2022-12-18 20:35:34 +02:00
sed -i \
-e 's/==.*$//' \
requirements.txt
cat >searx/version_frozen.py <<EOF
VERSION_STRING="${version}"
2023-06-06 01:03:47 +03:00
VERSION_TAG="1.0.0"
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
fasttext-predict
2022-12-18 20:35:34 +02:00
pybind11
pytomlpp
(callPackage ./deps/chompjs.nix {})
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/
'';
})