How to install whoogle

Hi All,

I’m new to nix and I’m trying to install whoogle. I tried to use the following:

{ stdenv, fetchFromGitHub, python3, systemd, ... }:

stdenv.mkDerivation rec {
  pname = "whoogle-search";
  version = "0.8.2";
  src = fetchFromGitHub {
    owner = "benbusby";
    repo = "whoogle-search";
    rev = "0003da4bb9645a1098c297a5e6e3efa2d9709407";  # Replace with the desired revision
    sha256 = "sha256-0O30DIICygPdUykfkjj7wr0I2i4x8m8v4HA0u8No348=";
  };

  buildInputs = [ python3 ];

  buildPhase = ''
    python3 -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt

    # Cleanup unused
    rm -r .git .github docs test .dockerignore .gitignore .replit docker-compose.yml Dockerfile heroku.yml MANIFEST.in README.md requirements.txt
  '';

  installPhase = ''
    install -Dm0644 whoogle "$out/etc/default/whoogle"
    install -Dm0644 whoogle.conf "$out/usr/lib/sysusers.d/whoogle.conf"
    install -Dm0644 whoogle.service "$out/usr/lib/systemd/system/whoogle.service"
    install -Dm0644 whoogle-search/LICENSE "$out/usr/share/licenses/whoogle-search/LICENSE"
    cp -r whoogle-search "$out/opt/"
  '';
}

and I get the following error no matter what I do:

error: builder for '/nix/store/fadpka68xhzb9w292pfahk6kd8pn5w8j-whoogle-search-0.8.2.drv' failed with exit code 1;
       last 10 log lines:
       > Ignoring cryptography: markers 'platform_machine == "armv7l"' don't match your environment
       > Ignoring pyOpenSSL: markers 'platform_machine == "armv7l"' don't match your environment
       > WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7ffff5800670>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/attrs/
       > WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7ffff5801120>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/attrs/
       > WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7ffff58012d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/attrs/
       > WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7ffff5801480>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/attrs/
       > WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7ffff5801630>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/attrs/
       > ERROR: Could not find a version that satisfies the requirement attrs==22.2.0 (from versions: none)
       > ERROR: No matching distribution found for attrs==22.2.0
       >

Any help would be greatly appreciated!! :heart:

Link to dotfiles: https://gitlab.com/hmajid2301/dotfiles/-/tree/nixos/modules

1 Like

Builds don’t have network access, so installing from pip in the middle of a build won’t work.

You can likely make the pip approach work in nix-shell (see Nixpkgs 22.11 manual | Nix & NixOS).

The Nix Way to make it work in nix-build is to specify all of the dependencies so that they can be downloaded/built before this build begins. python packaging can be ~work, so I hesitate to send you off on that adventure without really understanding how hard or simple whoogle will be to package.

Thanks! I will take a look later how much effort to package it.
I will use pipx for now to install it

1 Like