nixpkgs/pkgs/by-name/se/searxng/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

80 lines
1.9 KiB
Nix
Raw Normal View History

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";
version = "0-unstable-2024-03-08";
2022-02-25 19:43:21 +01:00
src = fetchFromGitHub {
owner = "searxng";
repo = "searxng";
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
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
propagatedBuildInputs = with python3.pkgs; [
2022-02-25 19:43:21 +01:00
babel
certifi
python-dateutil
fasttext-predict
2022-02-25 19:43:21 +01:00
flask
flask-babel
2022-02-25 19:43:21 +01:00
brotli
jinja2
lxml
pygments
pytomlpp
2022-02-25 19:43:21 +01:00
pyyaml
redis
uvloop
setproctitle
httpx
httpx-socks
markdown-it-py
] ++ 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/
# copy config schema for the limiter
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
})