summary refs log tree commit diff
diff options
context:
space:
mode:
authorrnhmjoj <rnhmjoj@inventati.org>2020-11-04 19:17:34 +0100
committerrnhmjoj <rnhmjoj@inventati.org>2021-01-11 08:41:15 +0100
commit92d55d57ebb3a186ea23b66f3587a36bee662785 (patch)
tree90cfeda8241c89ac67f626364ad802704a288570
parentb7ca2d144893b44fa5baacfdcf019682070d72a3 (diff)
downloadnixpkgs-92d55d57ebb3a186ea23b66f3587a36bee662785.tar
nixpkgs-92d55d57ebb3a186ea23b66f3587a36bee662785.tar.gz
nixpkgs-92d55d57ebb3a186ea23b66f3587a36bee662785.tar.bz2
nixpkgs-92d55d57ebb3a186ea23b66f3587a36bee662785.tar.lz
nixpkgs-92d55d57ebb3a186ea23b66f3587a36bee662785.tar.xz
nixpkgs-92d55d57ebb3a186ea23b66f3587a36bee662785.tar.zst
nixpkgs-92d55d57ebb3a186ea23b66f3587a36bee662785.zip
searx: make package friendly towards nginx/uWSGI
- Link the /static directory to make it easier to serve
- Export searx module for use in uWSGI (just import the module)
-rw-r--r--pkgs/servers/web-apps/searx/default.nix12
1 files changed, 9 insertions, 3 deletions
diff --git a/pkgs/servers/web-apps/searx/default.nix b/pkgs/servers/web-apps/searx/default.nix
index b56e430d995..e83ea892529 100644
--- a/pkgs/servers/web-apps/searx/default.nix
+++ b/pkgs/servers/web-apps/searx/default.nix
@@ -1,8 +1,8 @@
-{ lib, python3Packages, fetchFromGitHub, fetchpatch }:
+{ lib, python3, python3Packages, fetchFromGitHub, fetchpatch }:
 
 with python3Packages;
 
-buildPythonApplication rec {
+toPythonModule (buildPythonApplication rec {
   pname = "searx";
   version = "0.17.0";
 
@@ -34,10 +34,16 @@ buildPythonApplication rec {
     rm tests/test_robot.py # A variable that is imported is commented out
   '';
 
+  postInstall = ''
+    # Create a symlink for easier access to static data
+    mkdir -p $out/share
+    ln -s ../${python3.sitePackages}/searx/static $out/share/
+  '';
+
   meta = with lib; {
     homepage = "https://github.com/asciimoo/searx";
     description = "A privacy-respecting, hackable metasearch engine";
     license = licenses.agpl3Plus;
     maintainers = with maintainers; [ matejc fpletz globin danielfullmer ];
   };
-}
+})