diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -31,7 +31,7 @@
 utility with `--help` to see the complete list of supported command line flags.
 
 Detailed instructions how to use those generated files with Nix can be found at
-http://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure.
+https://nixos.org/nixpkgs/manual/#how-to-create-nix-builds-for-your-own-private-haskell-packages.
 
 `cabal2nix` can also build derivations for projects from other sources than
 hackage. You only need to provide an URI that points to a cabal project. The
diff --git a/cabal2nix.cabal b/cabal2nix.cabal
--- a/cabal2nix.cabal
+++ b/cabal2nix.cabal
@@ -1,5 +1,5 @@
 name:               cabal2nix
-version:            2.14.3
+version:            2.14.4
 synopsis:           Convert Cabal files into Nix build instructions.
 description:
   Convert Cabal files into Nix build instructions. Users of Nix can install the latest
diff --git a/src/Cabal2nix.hs b/src/Cabal2nix.hs
--- a/src/Cabal2nix.hs
+++ b/src/Cabal2nix.hs
@@ -193,7 +193,7 @@
   cabal2nix =<< getArgs
 
 hpackOverrides :: Derivation -> Derivation
-hpackOverrides = over phaseOverrides (++ "preConfigure = \"hpack\";")
+hpackOverrides = over phaseOverrides (++ "prePatch = \"hpack\";")
                . set (libraryDepends . tool . contains (PP.pkg "hpack")) True
 
 cabal2nix' :: Options -> IO (Either Doc Derivation)
diff --git a/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs b/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs
--- a/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs
+++ b/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs
@@ -291,8 +291,8 @@
 xmonadPostInstall :: String
 xmonadPostInstall = unlines
   [ "postInstall = ''"
-  , "  install -D man/xmonad.1 $doc/share/man/man1/xmonad.1"
-  , "  install -D man/xmonad.hs $doc/share/doc/$name/sample-xmonad.hs"
+  , "  install -D man/xmonad.1 ''${!outputDoc}/share/man/man1/xmonad.1"
+  , "  install -D man/xmonad.hs ''${!outputDoc}/share/doc/$name/sample-xmonad.hs"
   , "'';"
   ]
 
