fork
Configure Feed
Select the types of activity you want to include in your feed.
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 unstableGitUpdater,
6 fetchurl,
7 rustPlatform,
8 pkg-config,
9 oniguruma,
10 openssl,
11 zstd,
12}:
13
14rustPlatform.buildRustPackage {
15 pname = "stract";
16 version = "0-unstable-2025-03-24";
17
18 src = fetchFromGitHub {
19 owner = "StractOrg";
20 repo = "stract";
21 rev = "8ac40b023e0a49f55cdd5b599841ea46d0503ec9";
22 hash = "sha256-HrZ70RuBToa5m2DJN3KDHFoWae2YqHGpy1imwi+xvCo=";
23 fetchSubmodules = true;
24 };
25
26 cargoHash = "sha256-UArPGrcEfFZBOZ4Tv7NraqPzdMtyJXVFsfUM32eSGic=";
27
28 nativeBuildInputs = [ pkg-config ];
29
30 buildInputs = [
31 oniguruma
32 openssl
33 zstd
34 ];
35
36 env = {
37 RUSTONIG_SYSTEM_LIBONIG = true;
38 ZSTD_SYS_USE_PKG_CONFIG = true;
39 SWAGGER_UI_DOWNLOAD_URL =
40 let
41 # When updating:
42 # - Look for the version of `utoipa-swagger-ui` at:
43 # https://github.com/StractOrg/stract/blob/<STRACT-REV>/Cargo.toml#L183
44 # - Look at the corresponding version of `swagger-ui` at:
45 # https://github.com/juhaku/utoipa/blob/utoipa-swagger-ui-<UTOPIA-SWAGGER-UI-VERSION>/utoipa-swagger-ui/build.rs#L21-L22
46 swaggerUiVersion = "5.17.12";
47 swaggerUi = fetchurl {
48 url = "https://github.com/swagger-api/swagger-ui/archive/refs/tags/v${swaggerUiVersion}.zip";
49 hash = "sha256-HK4z/JI+1yq8BTBJveYXv9bpN/sXru7bn/8g5mf2B/I=";
50 };
51 in
52 "file://${swaggerUi}";
53 };
54
55 # swagger-ui will once more be copied in the target directory during the check phase
56 # Not deleting the existing unpacked archive leads to a `PermissionDenied` error
57 preCheck = ''
58 rm -rf target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/build/
59 '';
60
61 checkFlags = [
62 # error: struct `MyCustomDocument` is never constructed
63 "--skip=schema::document"
64 # thread 'ampc::dht::tests::proptest_chaos' panicked at crates/core/src/ampc/dht/mod.rs:670:33:
65 # assertion `left == right` failed
66 "--skip=ampc::dht::tests::proptest_chaos"
67 ];
68
69 passthru.updateScript = unstableGitUpdater { };
70
71 meta = {
72 description = "Open source web search engine";
73 longDescription = ''
74 Stract is an open source web search engine targeted towards tinkerers and
75 developers, with an official instance hosted at stract.com
76 '';
77 homepage = "https://github.com/StractOrg/stract";
78 license = lib.licenses.agpl3Only;
79 maintainers = with lib.maintainers; [
80 ailsa-sun
81 ];
82 teams = [ lib.teams.ngi ];
83 };
84}