Giter Club home page Giter Club logo

nix_version_search_cli's Introduction

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/423e829ee2f40e99be233de63f09d44dd39e9f67.tar.gz
# or, if you have flakes:
nix profile install 'https://github.com/jeff-hykin/nix_version_search_cli/archive/423e829ee2f40e99be233de63f09d44dd39e9f67.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

nix_version_search_cli's People

Contributors

jeff-hykin avatar heinwol avatar

Stargazers

98765abc avatar Henri Sota avatar Ivan Kovnatsky avatar MiSumiSumi avatar Edgar B avatar Gabriel Fontes avatar Daniel Fahey avatar Ralf Schmitt avatar Daniel Karapishchenko avatar Alexis Quintero avatar Egis avatar Caleb P. Bradley avatar Quentin Guilloteau avatar Harsh Thakur avatar Lucas C Wilcox avatar Nikita Volodin avatar clamydo avatar Zhong Jianxin avatar  avatar Achille Lacoin avatar David Hagege avatar Bruno Adele avatar  avatar Federico Damián Schonborn avatar Dawid Dziurla avatar

Watchers

 avatar  avatar

Forkers

heinwol qwqawawow

nix_version_search_cli's Issues

Flake installation not working

After installing from the repos flake, im getting a lot of warnings and errors.

nvs nodejs
warning: Use of deprecated "Deno.writeAllSync()" API. This API will be removed in Deno 2. Run again with DENO_VERBOSE_WARNINGS=1 to get more details.
⠋ fetchingwarning: Use of deprecated "Deno.customInspect" API. This API will be removed in Deno 2. Run again with DENO_VERBOSE_WARNINGS=1 to get more details.
√ finished fetch
? Which Package [type OR press enter OR use arrow keys] › warning: Use of deprecated "Deno.stdin.rid" API. This API will be removed in Deno 2. Run again with DENO_VERBOSE_WARNINGS=1 to get more details.                 : Event-driven I/O framework for the V8 JavaScript engine
warning: Use of deprecated "Deno.isatty()" API. This API will be removed in Deno 2. Run again with DENO_VERBOSE_WARNINGS=1 to get more details.
Failed getting version info from one of the sources (nixhub.io):I/O framework for the V8 JavaScript engine
    Error: Looks like www.nixhub.io has updated, meaning this CLI tool needs to be updated (issue finding list $("main ul"))
  nodejs-slim_latest                             : Event-driven I/O framework for the V8 JavaScript engine
error: Uncaught (in promise) TypeError: Cannot read properties of null (reading 'filter')JavaScript engine
      if (versions.filter((each2) => each2.version.startsWith(versionPrefix)).length == 0) {aScript engine
                   ^js-repl                      :
    at file:///nix/store/l462xk35gch0qkwmh75lif6xmk8dljzp-source/build_helper/main.bundle.js:212747:20
    at eventLoopTick (ext:core/01_core.js:63:7)

After some cleanup

warning: Use of deprecated "Deno.customInspect" API. This API will be removed in Deno 2. Run again with DENO_VERBOSE_WARNINGS=1 to get more details.
warning: Use of deprecated "Deno.stdin.rid" API. This API will be removed in Deno 2. Run again with DENO_VERBOSE_WARNINGS=1 to get more details.
warning: Use of deprecated "Deno.isatty()" API. This API will be removed in Deno 2. Run again with DENO_VERBOSE_WARNINGS=1 to get more details.
Failed getting version info from one of the sources (nixhub.io):I/O framework for the V8 JavaScript engine
   Error: Looks like www.nixhub.io has updated, meaning this CLI tool needs to be updated (issue finding list $("main ul"))
error: Uncaught (in promise) TypeError: Cannot read properties of null (reading 'filter')JavaScript engine
   if (versions.filter((each2) => each2.version.startsWith(versionPrefix)).length == 0) {aScript engine
                ^js-repl                      :
 at file:///nix/store/l462xk35gch0qkwmh75lif6xmk8dljzp-source/build_helper/main.bundle.js:212747:20
 at eventLoopTick (ext:core/01_core.js:63:7)

The deprecation warnings ill be happy to submit a pr to fix, but the exception itself and the update to the cli message i have no clue about.

Thanks for the cool tool regardless

Printed url for flake does not work: Unexpected fragment

Using an URL like spdlog.url = "https://github.com/NixOS/nixpkgs/archive/407f8825b321617a38b86a4d9be11fd76d513da2.tar.gz#spdlog", as suggested by nvs as an input of an flake results in error: unexpected fragment 'spdlog' in flake reference 'https://github.com/NixOS/nixpkgs/archive/407f8825b321617a38b86a4d9be11fd76d513da2.tar.gz#spdlog'.

Whereas nix run https://github.com/NixOS/nixpkgs/archive/407f8825b321617a38b86a4d9be11fd76d513da2.tar.gz#hello works.

Giving an empty arg on cli errors

# nvs
⠋ fetchingerror: Uncaught TypeError: Cannot read properties of undefined (reading 'parse')
    return command.parse(["--help"].concat(Deno.args));
                   ^
    at _Command.actionHandler (file:///nix/store/v2fsasnkp9xbmcz2vl89h2c38p6mlyq8-source/build_helper/main.bundle.js:208462:20)
    at _Command.execute (file:///nix/store/v2fsasnkp9xbmcz2vl89h2c38p6mlyq8-source/build_helper/main.bundle.js:3705:18)
    at async _Command.parseCommand (file:///nix/store/v2fsasnkp9xbmcz2vl89h2c38p6mlyq8-source/build_helper/main.bundle.js:3582:14)
    at async file:///nix/store/v2fsasnkp9xbmcz2vl89h2c38p6mlyq8-source/build_helper/main.bundle.js:208452:15

Awesome tool!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.