diff --git a/nofib.head b/nofib.head
new file mode 100644
index 0000000000000000000000000000000000000000..30fa13ebbad51fbb65c2090d39417effebfe9a27
--- /dev/null
+++ b/nofib.head
@@ -0,0 +1,13 @@
+-- A cabal.project file to be used with hackage head.
+-- Use by running `cabal --project-file nofib.head <usual command>`
+
+packages: shake
+
+repository head.hackage.ghc.haskell.org
+   url: https://ghc.gitlab.haskell.org/head.hackage/
+   secure: True
+   key-threshold: 3
+   root-keys:
+       f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
+       26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
+       7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
\ No newline at end of file
diff --git a/shake/README.mkd b/shake/README.mkd
index 5e8e409725c0735407f2ea7f4cbdc381c2ccb966..abb75f132059bcb08fd51e77f01a94d1cf074928 100644
--- a/shake/README.mkd
+++ b/shake/README.mkd
@@ -6,6 +6,12 @@ variety of compile- and run-time metrics. These metrics are recorded in a
 common semi-structured CSV file format, which can be compared and analysed with
 the included `nofib-compare` utility.
 
+## Hackage head support
+
+Simply pass `--head` to the shake runner to use hackage.head.
+
+This works by using `nofib.head` as cabal project file for test dependencies instead of
+`cabal.project`.
 
 ## Usage
 
diff --git a/shake/runner/Main.hs b/shake/runner/Main.hs
index 67ef1407410bee24d8f0bd3cdc16ee5196863752..ab37c55edffad472e000ecfa817d280d4330d725 100644
--- a/shake/runner/Main.hs
+++ b/shake/runner/Main.hs
@@ -249,7 +249,9 @@ buildRules nofib@Build{..} = do
         -- TODO: Invoking cabal in the way we do without any package argument fails.
         root <- liftIO $ IO.makeAbsolute buildDepsRoot
         unless (null deps) $ withResource pkgDbResource 1 $
-            cmd_ "cabal" ("--store-dir=" <> root) "v2-install" "--lib" "-w" compiler "--allow-newer" deps ("-j"<> show threads)
+            let project_file = if useHackageHead then "--project-file=nofib.head" else ""
+            in
+            cmd_ "cabal" project_file ("--store-dir=" <> root) "v2-install" "--lib" "-w" compiler "--allow-newer" deps ("-j"<> show threads)
         liftIO $ writeFile out ""
 
     -- Benchmark rules
diff --git a/shake/runner/RunnerTypes.hs b/shake/runner/RunnerTypes.hs
index 510f6cd456b190398a5f5ced5b268a82b53d2fcd..6de6204d488ff77f6194636b4adf7b780667ed1c 100644
--- a/shake/runner/RunnerTypes.hs
+++ b/shake/runner/RunnerTypes.hs
@@ -66,6 +66,7 @@ data Nofib
         ,rts_args :: [String]
         ,times :: Int
         ,keepGoing :: Bool
+        ,useHackageHead :: Bool -- ^ Use hackage.head via nofib.head project file
         ,verbosity :: Int -- ^ Default 1
         }
     deriving (Show)
@@ -105,6 +106,7 @@ nofibMode =
     <*> many (option str (long "rts-arg" <> help "Extra arguments to pass to runtime system when running"))
     <*> option auto (long "times" <> short 't' <> value 1 <> help "Number of times to run each test")
     <*> switch (long "keep-going" <> help "Ignore output missmatches")
+    <*> switch (long "head" <> help "Use nofib.head project file for building test dependencies.")
     <*> option auto (long "verbosity" <> short 'v' <> short 'V' <> value 1 <> help "Verbosity, default = 1")