title: What's the shortest `shell.nix` equivalent of the following cmdline arguments?
body: <p>What's the shortest <code>shell.nix</code> equivalent of the following cmdline arguments?</p>
  
  <pre><code>nix-shell -p "haskell.packages.ghc865.ghcWithPackages (p: [p.ghci-pretty])"
  </code></pre>
  
  <p>This works, but it's verbose:</p>
  
  <pre><code># contents of shell.nix file
  # run with the following cmd:
  # nix-shell shell.nix
  { nixpkgs ? import &lt;nixpkgs&gt; {} }:
  let
    inherit nixpkgs;
    inherit (nixpkgs) haskellPackages;
    haskellDeps = a: with a; [
      ipprint
      base
      hscolour
      ghci-pretty
    ];
    ghc = nixpkgs.haskellPackages.ghcWithPackages haskellDeps;
  
    nixPackages = [
      haskellPackages.cabal-install
      ghc
    ];
  in
  nixpkgs.stdenv.mkDerivation {
    name = "profile_name";
    buildInputs = nixPackages;
  }
  </code></pre>