title: NixOS beginner: xmonad and haskellmode in NixOS 14.04
body: <p>I'm trying so set up a NixOS VM for code development in haskell, and got into troubles with the basic installation of both xmonad and emacs. The relevant part of my <code>/etc/nixos/configuration.nix</code> is</p>
  
  <pre><code>environment.systemPackages = with pkgs; [
      emacs
      emacs24Packages.haskellMode
      xlibs.xmessage
      haskellPackages.haskellPlatform.ghc
      haskellPackages.xmobar
      haskellPackages.xmonad
      haskellPackages.xmonadContrib
      haskellPackages.xmonadExtras
  ];
  </code></pre>
  
  <ul>
  <li><p>xmonad: when I try to compile the code, xmonad complains that it couldn't find the module XMonad.Util.EZConfig.
  Compiling <code>xmonad.hs</code> with ghc is ok, and I'm also able to load the module into ghci.
  On the #nixos channel, I was told to use the function ghcWithPackages, but I wasn't able to correct the problem. Moreover, I'd like to understand why there is this problem in the first place, as it seems to me that this is a very simple use case. A minimal <code>xmonad.hs</code> with which I have the problem is:</p>
  
  <pre><code>import XMonad
  import XMonad.Util.EZConfig
  
  main = xmonad $ defaultConfig
    { modMask = mod4Mask
    , terminal = "konsole"
    }
    `additionalKeysP`
    [ ("M-e", spawn "emacs")
    , ("M-f", spawn "firefox")
    ]
  </code></pre></li>
  <li><p>emacs: after the installation of the package haskellmode (look at the configuration.nix above), I'm not able to enter haskell-mode in emacs.</p></li>
  </ul>
  
  <p>I put together these problems as I suspect they're both caused by a fundamental incomprehension of something on my behalf, so the cause may be common.</p>