[Nix-dev] some basic questions from a new NixOS user

Peter Simons simons at cryp.to
Tue Nov 29 18:02:33 CET 2011


Hi Linus,

 > But I must ask, how did you install xmonad? I tried "nix-env -i
 > xmonad" but it did not work [...]

Haskell packages that contain library code generally depend on the
version of the compiler they've been built with. Almost all Haskell
packages have the appropriate compiler version baked into their package
name. Consequently, there are many different versions of XMonad:

  $ nix-env -qaP \* | grep xmonad-ghc
  haskellPackages_ghc6104.xmonad                   haskell-xmonad-ghc6.10.4-0.10
  haskellPackages_ghc6123.xmonad                   haskell-xmonad-ghc6.12.3-0.10
  haskellPackages_ghc704_no_profiling.xmonad       haskell-xmonad-ghc7.0.4-0.10
  haskellPackages_ghc704_profiling.xmonad          haskell-xmonad-ghc7.0.4-0.10-profiling
  haskellPackages_ghc721.xmonad                    haskell-xmonad-ghc7.2.1-0.10
  haskellPackages_ghc722.xmonad                    haskell-xmonad-ghc7.2.2-0.10

Which version is preferable to you depends on the compiler that you
prefer. At the moment, I would recommend to stick to GHC 7.0.4.


 > Strangely, it appears that the haskell packages cannot see each other
 > properly, because I cannot use any of the xmonad-contrib modules in
 > my xmonad.hs, even though I've installed xmonad-contrib. I can fire
 > up ghci, but I can't even load up the "XMonad" Haskell module,
 > either. Strange...

I cannot reproduce that problem:

  $ nix-env -iA haskellPackages.{xmonad,ghc}
  installing `haskell-xmonad-ghc7.0.4-0.10'
  installing `ghc-7.0.4-wrapper'
  building path(s) `/nix/store/6k520bqkbmcbqgl1s1371jr7zj2774b9-user-environment'
  created 7452 symlinks in user environment
  $ ghci
  GHCi, version 7.0.4: http://www.haskell.org/ghc/  :? for help
  Loading package ghc-prim ... linking ... done.
  Loading package integer-gmp ... linking ... done.
  Loading package base ... linking ... done.
  Loading package ffi-1.0 ... linking ... done.
  Prelude> :m XMonad
  Prelude XMonad> :browse
  (-->) :: (Monad m, Data.Monoid.Monoid a) => m Bool -> m a -> m a
  class Num a => Data.Bits.Bits a where
  [...]

Generally speaking, GHC can see all Haskell packages that have been
installed into the same profile as the compiler itself.

Take care
Peter



More information about the nix-dev mailing list