Skip to content

Nix Version Search CLI - user friendly way to find any version

License

Notifications You must be signed in to change notification settings

jeff-hykin/nix_version_search_cli

Repository files navigation

What is this?

A CLI tool for finding/using versions of nix packages!

cli command usage with dynamic responses

How to install

Make sure you have nix installed:

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install

Then install nvs:

nix-env -i -f https://github.com/jeff-hykin/nix_version_search_cli/archive/1a257742b17f5c4cf37276d6aa6b022c8e5f8f7e.tar.gz
# or, if you have flakes:
nix profile install 'https://github.com/jeff-hykin/nix_version_search_cli/archive/1a257742b17f5c4cf37276d6aa6b022c8e5f8f7e.tar.gz#nvs'

How to use

There's one command with a few usages:

  • nvs --install <nameOfSomething> works like apt-get install/brew install. After you select a version, it will get system installed.
  • nvs --dry-install <nameOfSomething> show the nix command (if you want to run it yourself)
  • nvs <nameOfSomething> will give copy-pastable code for a shell.nix, default.nix, or flake.nix file.
  • nvs --repl <nameOfSomething> give copy-pastable code for accessing the package anywhere in nix (e.g. after running nix repl)
  • nvs --shell <nameOfSomething> if you want want the command for an interactive nix shell that has the package

Example

If you want to use the "python" package in some nix code do:

➜ 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

About

Nix Version Search CLI - user friendly way to find any version

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published