Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
119 lines
2.7 KiB
Nix
119 lines
2.7 KiB
Nix
{
|
|
lib,
|
|
python3,
|
|
fetchFromGitHub,
|
|
nixosTests,
|
|
unstableGitUpdater,
|
|
}:
|
|
let
|
|
python = python3.override {
|
|
packageOverrides = final: prev: { };
|
|
};
|
|
in
|
|
python.pkgs.toPythonModule (
|
|
python.pkgs.buildPythonApplication rec {
|
|
pname = "searxng";
|
|
version = "0-unstable-2025-09-11";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "searxng";
|
|
repo = "searxng";
|
|
rev = "7c1ebc01489a5b96d4abb0ad9c1180701eb4456c";
|
|
hash = "sha256-nOIt4PyO6DALz7gw5Hh1w1ZDyEAsQAVp4O/eFOLYZ0A=";
|
|
};
|
|
|
|
nativeBuildInputs = with python.pkgs; [ pythonRelaxDepsHook ];
|
|
|
|
pythonRelaxDeps = [
|
|
"certifi"
|
|
"flask"
|
|
"flask-babel"
|
|
"httpx-socks"
|
|
"lxml"
|
|
"typer-slim"
|
|
"whitenoise"
|
|
];
|
|
|
|
preBuild =
|
|
let
|
|
versionString = lib.concatStringsSep "." (
|
|
builtins.tail (lib.splitString "-" (lib.removePrefix "0-" version))
|
|
);
|
|
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
|
|
'';
|
|
|
|
build-system = with python.pkgs; [ setuptools ];
|
|
|
|
dependencies =
|
|
with python.pkgs;
|
|
[
|
|
babel
|
|
brotli
|
|
certifi
|
|
cryptography
|
|
fasttext-predict
|
|
flask
|
|
flask-babel
|
|
httpx
|
|
httpx-socks
|
|
isodate
|
|
jinja2
|
|
lxml
|
|
markdown-it-py
|
|
msgspec
|
|
pygments
|
|
python-dateutil
|
|
pyyaml
|
|
setproctitle
|
|
typer-slim
|
|
uvloop
|
|
valkey
|
|
whitenoise
|
|
]
|
|
++ httpx.optional-dependencies.http2
|
|
++ httpx-socks.optional-dependencies.asyncio;
|
|
|
|
# tests try to connect to network
|
|
doCheck = false;
|
|
|
|
postInstall = ''
|
|
# Create a symlink for easier access to static data
|
|
mkdir -p $out/share
|
|
ln -s ../${python.sitePackages}/searx/static $out/share/
|
|
|
|
# copy config schema for the limiter
|
|
cp searx/limiter.toml $out/${python.sitePackages}/searx/limiter.toml
|
|
'';
|
|
|
|
passthru = {
|
|
tests = {
|
|
searxng = nixosTests.searx;
|
|
};
|
|
updateScript = unstableGitUpdater { hardcodeZeroVersion = true; };
|
|
};
|
|
|
|
meta = with lib; {
|
|
homepage = "https://github.com/searxng/searxng";
|
|
description = "Fork of Searx, a privacy-respecting, hackable metasearch engine";
|
|
license = licenses.agpl3Plus;
|
|
mainProgram = "searxng-run";
|
|
maintainers = with maintainers; [
|
|
SuperSandro2000
|
|
_999eagle
|
|
];
|
|
};
|
|
}
|
|
)
|