title: When and how should default.nix, shell.nix and release.nix be used?
body: <p>One of the first types of Nix expression one encounters when learning how to use the Nix package manager is <code>default.nix</code>; on the wonderful NixOS IRC channel I learned of the existence of <code>shell.nix</code> and <code>release.nix</code> as well. </p>
  
  <p>I got the impression that - roughly -<code>default.nix</code> is to be used with <code>nix-build</code> for simply building the package, <code>shell.nix</code> is used with <code>nix-shell</code> to create an interactive environment with the package and <code>release.nix</code> is used with <code>nixops</code> in deploying the package.</p>
  
  <p>Since this is likely incomplete and partially incorrect, and since this does not seem to be clearly documented, I would like a clear and precise explanation of these sorts of "standard files"; in particular, <em>for each of these file types</em> (as well as any other standard files I am missing), I would like to know:</p>
  
  <ol>
  <li>What are the typical use cases for such a file? What should they <em>not</em> be used for?</li>
  <li>How is this file type structured typically? What are the minimal requirements for it?</li>
  <li>Could you show a paradigm example of such a file <em>within its use context</em>, i.e. with use instructions and including lines of code needed to use it in the shell or another Nix expression?</li>
  </ol>
  
  <p>As an additional bonus question, I want to know which - if any - of these standard files should be used when installing a package into a NixOS module? How would that be done?</p>