Search auxolotl packages and options. Forked from https://github.com/nixos/nixos-search
Go to file
dependabot[bot] 00f61f52ae
Dependabot(deps): Bump cachix/install-nix-action from 22 to 23 (#686)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 22 to 23.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v22...v23)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 10:32:53 +02:00
.github Dependabot(deps): Bump cachix/install-nix-action from 22 to 23 (#686) 2023-09-05 10:32:53 +02:00
flake-info Bundle pandoc filters (#670) 2023-07-03 22:03:00 +02:00
flakes Adds Hyprland (#608) 2023-01-31 17:20:25 +01:00
frontend frontend: fixup for empty queries 2023-06-11 13:06:27 +02:00
.envrc Cleanup (#450) 2022-03-17 23:00:10 +01:00
.gitignore Update npm dependencies (also flake.lock: Update) (#532) 2022-11-03 22:26:58 +01:00
flake.lock Revert most of "flake.lock: Update (#648)" 2023-07-03 19:46:32 +02:00
flake.nix Remove remaining usages of NIXPKGS_PANDOC_FILTERS_PATH (#679) 2023-08-18 17:30:24 +02:00
overlay.nix Workflow improvements (#458) 2022-03-30 20:45:35 +02:00
README.md Add support for sourcehut links (#517) 2022-08-23 14:42:06 +02:00
VERSION Render descriptions as Markdown (#667) 2023-06-28 17:44:44 +02:00

search.nixos.org

This repository contains the scripts and the web application for search.nixos.org.

How this project came to be

Initial idea was to replace NixOS packages and options search which was fetching one JSON file which contained all packages (or options). This approach is good for its simple setup, but started to show its problems when packages number was getting bigger and bigger. I'm sure we could optimize it further, but ideas what all could we do if there would be some database in the back were to tempting not to try.

For backend we are using Elasticsearch instance which is kindly sponsored by bonsai.io. On the frontend we are using Elm.

How search works?

The use case we want to solve is that a visitor want to see if a package exists or to look up certain package's details.

A user wants to converge to a single result if possible. The more characters are added to a search query the more narrow is search is and we should show less results.

Very important is also ranking of search results. This will bring more relevant search results to the top, since a lot of times it is hard to produce search query that will output only one result item.

A less important, but providing better user experience. are suggestions for writing better search query. Suggesting feature should guide user to write better queries which in turn will produce better results.

Development

To start developing open a terminal and run:

env --chdir=frontend nix develop -c yarn dev

You can point your browser to http://localhost:3000 and start developing. Any changes to source files (./frontend/src) will trigger a hot reload of an application.

Deploying

  • On each commit to main branch a GitHub Action is triggered.
  • GitHub Action then builds production version of the web application using yarn prod command.
  • The built web application (in ./dist) is then deployed to Netlify.
  • GitHub Action can also be triggered via Pull Request, which if Pull Request was created from a non-forked repo's branch, will provide a preview url in a comment.

Adding flakes

To add your own flakes to the search index edit ./flakes/manual.toml.

Possible types are github, gitlab, sourcehut, and git (which is the fallback for any kind of git repository but requires to set a revision key manually as of now).

To test whether your flake is compatible with nix flake-info you can try running flake-info against it

$ nix run github:nixos/nixos-search#flake-info -- flake <your flake handle>