Installing packages from github

Hi Project IDX community !
In a situation where a particular version of a package is not available in nixpkgs is there an easy way to install it based on the release from GitHub and if so how best to do it?

Cheers

Thanks for trying out idx! If this is a language specific package, packages can be installed through that instead (ex: pip, npm).

Are you able to share what specifc package you are trying to install please?

Hi Alex :slight_smile:

I agree when it comes to language-specific packages.
I am trying to install the R language (which is available in nix packages, but only one version, and I need a specific one).

Additionally, I wanted to try out GitHub - wavetermdev/waveterm: An open-source, cross-platform terminal for seamless workflows and unfortunately, it is not available as a nix package.

We encourage using nix because it is reproducible. Can we try a few things first please?

Which version of R do you need, can it be found here?

https://lazamar.co.uk/nix-versions/?package=R&version=3.2.1&fullName=R-3.2.1&keyName=R&revision=b860b106c548e0bcbf5475afe9e47e1d39b1c0e7&channel=nixpkgs-unstable

If it can, can you try the snippet below in the packages block instead of pkgs.R please? Example below is for 3.2.1 (it matches b860b106c548e0bcbf5475afe9e47e1d39b1c0e7 in the link above).

(let pkgs2 = import (builtins.fetchTarball {
        url = "https://github.com/NixOS/nixpkgs/archive/b860b106c548e0bcbf5475afe9e47e1d39b1c0e7.tar.gz";
    }) {}; in pkgs2).R

Building might take a bit time so not ideal, but Iā€™m wondering if this will at least allow you to use different R versions.

1 Like

Thank you!
This is definitely a reasonable way to install a specific package version.
is there a similar way to install a package not present in the nix registry?

Taking above Wave terminal as example :wink: