diff --git a/pkgs/by-name/we/websurfx/package.nix b/pkgs/by-name/we/websurfx/package.nix new file mode 100644 index 000000000000..724b41098867 --- /dev/null +++ b/pkgs/by-name/we/websurfx/package.nix @@ -0,0 +1,60 @@ +{ + lib, + fetchFromGitHub, + rustPlatform, + openssl, + pkg-config, +}: +let + version = "1.20.7"; +in +rustPlatform.buildRustPackage { + pname = "websurfx"; + inherit version; + + src = fetchFromGitHub { + owner = "neon-mmd"; + repo = "websurfx"; + rev = "refs/tags/v${version}"; + hash = "sha256-fpyelpzskwuVrQB1SZ3llnenox7MiOeF+sSJONSdEf0="; + }; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ + openssl + ]; + + useFetchCargoVendor = true; + + cargoHash = "sha256-LnMVfsKb1oTsEKmD/dDnABbWyrYC52e9ASbcMY7qXMw="; + + postPatch = '' + substituteInPlace src/handler/mod.rs \ + --replace-fail "/etc/xdg" "$out/etc/xdg" \ + --replace-fail "/opt/websurfx" "$out/opt/websurfx" + ''; + + postInstall = '' + mkdir -p $out/etc/xdg + mkdir -p $out/opt/websurfx + + cp -r websurfx $out/etc/xdg/ + cp -r public $out/opt/websurfx/ + ''; + + meta = { + description = "Open source alternative to searx"; + longDescription = '' + An open source alternative to searx which provides a modern-looking, + lightning-fast, privacy respecting, secure meta search engine. + ''; + homepage = "https://github.com/neon-mmd/websurfx"; + changelog = "https://github.com/neon-mmd/websurfx/releases"; + license = lib.licenses.agpl3Plus; + maintainers = with lib.maintainers; [ theobori ]; + mainProgram = "websurfx"; + }; +}