prism-sync
prism-sync is the background maintenance utility for the Prism package management system. Its sole responsibility is to build and maintain a local "package database." This database allows prism-install to provide near-instantaneous fuzzy search results without needing to query the internet or the vast Nixpkgs tree in real-time.
How it works
- Cache Preparation: It ensures the directory
~/.cache/prismexists. - Package Indexing: It runs
nix-env -qaP --description.- -q (Query): Looks for packages.
- -a (Available): Looks for what can be installed, not just what is installed.
- -P (Path): Includes the attribute path (e.g.,
nixpkgs.firefoxinstead of justfirefox). - --description: Fetches the brief summary of each package.
- Sanitization: It uses
grepto filter outnixos.attribute paths. These are often internal modules or configuration functions rather than installable binaries, and attempting to index them can cause the script to error out. - Storage: The final output is saved to
~/.cache/prism/pkglist.txt, which serves as the "source of truth" for theprism-installUI.
Dependencies
nix: The primary tool used to query the repository.coreutils: For directory management (mkdir) and line counting (wc).
Usage
This script is typically run automatically by prism-install if the cache is missing, but can be run manually to refresh the list after a Nix channel update.
prism-sync