https://github.com/jeff-hykin/nix_version_search_cli
Nix Version Search CLI - user friendly way to find any version
https://github.com/jeff-hykin/nix_version_search_cli
nixpkgs search versions
Last synced: 7 months ago
JSON representation
Nix Version Search CLI - user friendly way to find any version
- Host: GitHub
- URL: https://github.com/jeff-hykin/nix_version_search_cli
- Owner: jeff-hykin
- License: mit
- Created: 2023-11-12T15:35:47.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-30T11:17:59.000Z (almost 2 years ago)
- Last Synced: 2025-02-14T03:51:50.789Z (over 1 year ago)
- Topics: nixpkgs, search, versions
- Language: JavaScript
- Homepage:
- Size: 155 MB
- Stars: 30
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
## What is this?
A CLI tool for finding/using versions of nix packages!

## How to install
Make sure you have nix installed:
```sh
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
```
Then install nvs:
```sh
nix-env -i -f https://github.com/jeff-hykin/nix_version_search_cli/archive/50a3fef5c9826d1e08b360b7255808e53165e9b2.tar.gz
# or, if you have flakes:
nix profile install 'https://github.com/jeff-hykin/nix_version_search_cli/archive/50a3fef5c9826d1e08b360b7255808e53165e9b2.tar.gz#nvs'
```
## How to use
Examples:
```sh
nvs --install python
nvs --install python@3
nvs --install python@3.10
nvs --repl python
nvs --shell python
```
Examples Explained:
- `nvs --install ` works like `apt-get install`/`brew install`. After you select a version, it will get system installed.
- `nvs --dry-install ` show the nix command (if you want to run it yourself)
- `nvs ` will give copy-pastable code for a `shell.nix`, `default.nix`, or `flake.nix` file.
- `nvs --repl ` give copy-pastable code for accessing the package anywhere in nix (e.g. after running `nix repl`)
- `nvs --shell ` if you want want the command for an interactive nix shell that has the package
## Full Output Example
If you want to use the "python" package in some nix code do:
```sh
➜ nvs python@3
? Which Package [type OR press enter OR use arrows] ›
python : A high-level dynamically-typed programming language
python-qt : PythonQt is a dynamic Python binding for the Qt framework. It offers an easy way to embed the Python
python-full : A high-level dynamically-typed programming language
python2nix :
pythonIRClib : Python IRC library
python-minimal : A high-level dynamically-typed programming language
python-launcher : An implementation of the `py` command for Unix-based platforms
mate.python-caja : Python binding for Caja components
...
Selected: python
? Pick a version ›
3.13.0a1
3.12.0
3.12.0rc3
3.12.0rc2
3.12.0b4
3.12.0b3
3.12.0b2
3.12.0b1
...
Here is what to include in your nix code:
python = (
(import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/75a52265bda7fd25e06e3a67dee3f0354e73243c.tar.gz";
}) {}).python312
);
If you are not sure how to use this^
Run: nvs --explain python@3
```
# How does it work?
Many other people are doing heavy lifting, this is just a CLI interface that standardizes and aggregates them. This tool grabs from 3 main sources:
- https://history.nix-packages.com/
- https://www.nixhub.io/search (the jetify guys)
- https://lazamar.co.uk/nix-versions/
This means, sometimes, the CLI is slow because one of those sites hang. It also means when they change their site a lot (only nixhub basically) it can break the CLI, or at least weaken the results.