0

Here is this Haskell package. For this package there is a distribution for NixOS.

If such a distribution for NixOS exists then is it easy to install the same package to Ubuntu on which the Nix package manager is installed ?

If yes, how ?

If not, why not ?

jhegedus
  • 20,244
  • 16
  • 99
  • 167

2 Answers2

2

For this package there is a distribution for NixOS.

There is no distribution for NixOS. NixOS is the actual Linux distribution built on top of Nix package manager. Your link just shows their Hydra build farm which is used for building various nix packages.

If such a distribution for NixOS exists then is it easy to install the same package to Ubuntu on which the Nix package manager is installed ?

Again, no such distribution exists. If you want to use Nix in your Ubuntu distribution then you can install just the Nix package manager and can install any package using the nix-env tool. An example to install the Haskell text package:

nix-env -i -A nixpkgs.haskellPackages.text
Sibi
  • 47,472
  • 16
  • 95
  • 163
0

The answer to you question can be found in the Nixpkgs user manual. I'm citing the relevant bit from "8.5.1. How to install Haskell packages":

We [keep] all Haskell-related packages in a separate attribute set called haskellPackages, which the following command will list:

$ nix-env -f "<nixpkgs>" -qaP -A haskellPackages
haskellPackages.a50         a50-0.5
haskellPackages.abacate     haskell-abacate-0.0.0.0
haskellPackages.abcBridge   haskell-abcBridge-0.12
haskellPackages.afv         afv-0.1.1
haskellPackages.alex        alex-3.1.4
haskellPackages.Allure      Allure-0.4.101.1
haskellPackages.alms        alms-0.6.7
[... some 8000 entries omitted  ...]

To install any of those packages into your profile, refer to them by their attribute path (first column):

$ nix-env -f "<nixpkgs>" -iA haskellPackages.Allure ...

The attribute path of any Haskell packages corresponds to the name of that particular package on Hackage: the package cabal-install has the attribute haskellPackages.cabal-install, and so on.

In your specific case, this means that running

nix-env -f "<nixpkgs>" -iA haskellPackages.SourceGraph

or

nix-shell -p haskellPackages.SourceGraph

will make that package available for you to run.

Peter Simons
  • 1,752
  • 17
  • 17