title: How can I nix-env install a derivation from a nix expression file?
body: <p>I've got a <code>default.nix</code> file that builds a derivation (at least my understanding of it).</p>
  
  <pre><code>{ nixpkgs ? import &lt;nixpkgs&gt; {}, compiler ? "ghc864" } :
  nixpkgs.pkgs.haskell.packages.${compiler}.callCabal2nix "bhoogle" (./.) {}
  </code></pre>
  
  <p>I can successfully <code>nix-build</code> this. Is there a way I can install this into my user profile with <code>nix-env</code> directly? For example something like <code>nix-env -i -f default.nix</code>.</p>
  
  <p>Otherwise I need to define a package in my system profile with something like:</p>
  
  <pre><code>  example = pkgs.callPackage /home/chris/example/default.nix {};
  </code></pre>