noogle/README.md

65 lines
2.1 KiB
Markdown
Raw Normal View History

2022-12-06 12:58:20 +03:00
🚧 under construction 🚧
Any contributions are welcome
2022-12-07 23:14:55 +03:00
# [Noogle](https://noogle.dev)
2022-11-26 12:36:08 +03:00
2022-11-26 12:51:42 +03:00
Noogle is a Nix API search engine. It allows you to search functions based on their types and other attributes in `nix` projects. In `nixpkgs` especially the `builtins` and `lib` attributes.
2022-11-26 12:36:08 +03:00
2022-11-26 12:51:42 +03:00
- Beginners-friendly search for nix and nix-related functions
- Expert search with directly typing type signatures
- Search functions based on:
- type
- signature
- name
- tree-search from one type to another
## How it works
2022-11-26 12:36:08 +03:00
2022-12-18 16:21:00 +03:00
### Indexers:
2022-11-26 12:36:08 +03:00
2022-12-18 16:21:00 +03:00
Data collections need to be up-to-date
Those collections are then combined and dumped somewhere (db / json)
For the indexing i currently use:
- Nixdoc (a fork) to collect nixpkgs.lib informations
- nix __dump-builtins + builtins-types.json for the nix builtins
As some parts of nix already have nixos modules their input/output can be discovered. I still lack some tool to integrate that into noogle.
### Search:
- haskell-like types are parsed and splitted between input and ouput
- text search, looks in all metadata fields for an exact matching word or character sequence. I dont have elastic search yet.
# View the prototype [here](https://noogle.dev)
2022-11-26 13:13:31 +03:00
2022-12-06 12:58:20 +03:00
## We need your help / what is missing
- Parsing `Types:` into a real type signature tree
- Upstream missing type informations (like in /lib/attrsets.nix)
- Write type signatures for the `builtins` in json
- Add path, where each function can be imported from. e.g. `lib.makeOverridable` or `lib.customisation.makeOverridable` (it is available in both sets)
- Website
- Make sure functions with missing type signatures can be found too
- Add filter by tags e.g. lib.lists
- Mobile optimization for reading on the go
- Clean up / enhance my nixdoc fork.
- Make the `sloppy` parser more error resistant
- Some valueable information can be used from the rnix AST ?
2022-12-06 12:58:48 +03:00
## Contribute
2022-12-06 12:59:06 +03:00
Contributions are very welcome just file a PR or issue
2022-11-26 12:36:08 +03:00
2022-11-26 12:51:42 +03:00
### Build this page
2022-11-26 12:36:08 +03:00
2022-11-26 12:51:42 +03:00
`nix build .#`
2022-11-26 12:36:08 +03:00
2022-11-26 12:51:42 +03:00
### Develop
2022-11-26 12:36:08 +03:00
`nix develop`
2022-11-26 12:51:42 +03:00
This command creates the node_modules folder with all needed dependencies based on dream2nix.