packages/searxng: init

This commit is contained in:
Max Headroom 2022-05-24 19:38:07 +02:00
parent 1b79b0842b
commit 06cc579839
2 changed files with 68 additions and 1 deletions

View file

@ -1,6 +1,7 @@
{ pkgs, inputs, system, ... }@args: { pkgs, inputs, system, ... }@args:
let let
inherit (pkgs) lib; inherit (pkgs) lib;
inherit (inputs) unstable;
dream2nix = inputs.dream2nix.lib2.init { dream2nix = inputs.dream2nix.lib2.init {
systems = [ system ]; systems = [ system ];
config = { config = {
@ -13,9 +14,10 @@ let
}); });
mkShell = import lib/devshell.nix args; mkShell = import lib/devshell.nix args;
in in
{ {
packages = { packages = rec {
ghost = let ghost = let
version = "4.41.3"; version = "4.41.3";
dream = dream2nix.makeFlakeOutputs { dream = dream2nix.makeFlakeOutputs {
@ -53,6 +55,16 @@ in
meta.mainProgram = "reflex"; meta.mainProgram = "reflex";
}; };
searxng = let
scope = pkgs.python3Packages.overrideScope (final: prev: let
pullDownPackages = pypkgs: lib.genAttrs pypkgs (pkgName:
final.callPackage "${unstable}/pkgs/development/python-modules/${pkgName}/default.nix" {}
);
in pullDownPackages [ "httpcore" "httpx" "httpx-socks" "h2" "python-socks" "socksio" ]);
in pkgs.callPackage ./web-apps/searxng rec {
python3Packages = scope;
};
sips = pkgs.callPackage ./servers/sips { }; sips = pkgs.callPackage ./servers/sips { };
}; };

View file

@ -0,0 +1,55 @@
{ lib, nixosTests, python3, python3Packages, fetchFromGitHub, fetchpatch }:
with python3Packages;
toPythonModule (buildPythonApplication rec {
pname = "searxng";
version = "20220520";
src = fetchFromGitHub {
owner = "searxng";
repo = "searxng";
rev = "61535a4c206aa247a6fa87697b70668048086e27";
sha256 = "sha256-Ek/YZ4YzXxA/spmEAgcqItSmsYa/aVTeOBZbFPqNpJ4=";
};
postPatch = ''
sed -i 's/==.*$//' requirements.txt
'';
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
];
# 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/
'';
})