diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,6 @@
+# 0.7.1
+- Generate stack packages `stack-yaml-packages.nix`
+
 # 0.7.0
 - Add compatibility with nixos-18.03
 - Drop compatibility with nixos-17-09
diff --git a/src/Distribution/Nixpkgs/Haskell/Stack/PrettyPrinting.hs b/src/Distribution/Nixpkgs/Haskell/Stack/PrettyPrinting.hs
--- a/src/Distribution/Nixpkgs/Haskell/Stack/PrettyPrinting.hs
+++ b/src/Distribution/Nixpkgs/Haskell/Stack/PrettyPrinting.hs
@@ -75,8 +75,7 @@
     , nest 2 "inherit pkgs stdenv;"
     , nest 2 "inherit (self) callPackage;"
     , "};"
-    , ""
-    ]
+     ]
   , "in callPackage (nixpkgs.path + \"/pkgs/development/haskell-modules\") {"
   , nest 2 $ vcat
     [ attr "ghc" ("pkgs.haskell.compiler." <> nixGhc)
@@ -87,8 +86,9 @@
     , "inherit haskellLib;"
     ]
   , "}"
-  ] where
-        nixGhc = toNixGhcVersion (oc ^. ocGhc)
+  ]
+  where
+    nixGhc = toNixGhcVersion (oc ^. ocGhc)
 
 overrideStackage :: StackResolver -> FilePath -> NonEmpty Derivation -> Doc
 overrideStackage stackResolver nixpkgsPath packages = vcat
@@ -146,6 +146,15 @@
   , ""
   , "in extensible-self"
   ]
+
+stackYamlPackages :: NonEmpty Derivation -> Doc
+stackYamlPackages packages = hcat
+  [ "self: { "
+  , "inherit (self) "
+  , text . intercalate " " $ NE.toList packageNames
+  , "; }" ]
+  where
+    packageNames = unPackageName . pkgName . packageId <$> packages
 
 toNixGhcVersion :: Version -> Doc
 toNixGhcVersion = (<>) "ghc" . toNixVersion . show . disp
diff --git a/src/Runner.hs b/src/Runner.hs
--- a/src/Runner.hs
+++ b/src/Runner.hs
@@ -25,8 +25,9 @@
 import System.IO (withFile, IOMode(..), hPutStrLn)
 import Text.PrettyPrint.HughesPJClass (Doc, render)
 
-import qualified Data.Set as Set
+import qualified Data.List.NonEmpty as NE
 import qualified Data.Map as Map
+import qualified Data.Set as Set
 import qualified LtsHaskell as LH
 
 run :: IO ()
@@ -51,6 +52,11 @@
         stackPackagesConfig = mkStackPackagesConfig opts
       stackConfPackages <- traverse (fmap mkNode . packageDerivation stackPackagesConfig hackageDb)
         $ stackConf ^. scPackages
+      stackConfExtraDeps  <- traverse (fmap mkNode . packageDerivation stackPackagesConfig hackageDb)
+        $ stackConf ^. scExtraDeps
+      let
+        stackConfAllPackages = maybe stackConfPackages ((<>) stackConfPackages)
+          $ NE.nonEmpty stackConfExtraDeps
 
       case buildTarget of
         TargetStackageClosure -> do
@@ -58,11 +64,11 @@
           let
             overrideConfig = mkOverrideConfig opts (siGhcVersion $ bpSystemInfo buildPlan)
             stackageSetConfig = if opts ^. optTweaks . tExtraDepsRevisionLatest
-              then extraDepsLatestConfig stackConfPackages packageSetConfig
+              then extraDepsLatestConfig stackConfAllPackages packageSetConfig
               else packageSetConfig
           stackagePackages <- buildStackagePackages stackageSetConfig buildPlan
           let
-            reachable = reachableDeps stackConfPackages
+            reachable = reachableDeps stackConfAllPackages
             -- Nixpkgs generic-builder puts hscolour on path for all libraries
             withHscolour pkgs =
               let hscolour = F.find ((== "hscolour") . nodeName) stackagePackages
@@ -84,14 +90,14 @@
           writeOutFile buildPlanFile (opts ^. optOutStackageConfig)
             $ pPrintOutConfig (bpSystemInfo buildPlan) nodes
           writeOutFile (stackYaml ^. syFilePath) (opts ^. optOutDerivation)
-            $ PP.overrideHaskellPackages overrideConfig (view nodeDerivation <$> stackConfPackages)
+            $ PP.overrideHaskellPackages overrideConfig (view nodeDerivation <$> stackConfAllPackages)
 
         TargetStackagePackages -> do
           (buildPlanFile, buildPlan, packageSetConfig) <- loadStackageBuildPlan hackageDb stackResolver opts sopts
           let
             overrideConfig = mkOverrideConfig opts (siGhcVersion $ bpSystemInfo buildPlan)
             stackageSetConfig = if opts ^. optTweaks . tExtraDepsRevisionLatest
-              then extraDepsLatestConfig stackConfPackages packageSetConfig
+              then extraDepsLatestConfig stackConfAllPackages packageSetConfig
               else packageSetConfig
             -- stackageLoader mHash pkgId =
             --   if pkgName pkgId `Set.member` reachable
@@ -104,14 +110,16 @@
           writeOutFile buildPlanFile (opts ^. optOutStackageConfig)
             $ pPrintOutConfig (bpSystemInfo buildPlan) nodes
           writeOutFile (stackYaml ^. syFilePath) (opts ^. optOutDerivation)
-            $ PP.overrideHaskellPackages overrideConfig (view nodeDerivation <$> stackConfPackages)
+            $ PP.overrideHaskellPackages overrideConfig (view nodeDerivation <$> stackConfAllPackages)
 
-        TargetStackageOverride ->
-          writeOutFile (stackYaml ^. syFilePath) (opts ^. optOutDerivation) $
-          PP.overrideStackage
-          (stackConf ^. scResolver)
-          (opts ^. optNixpkgsRepository)
-          (view nodeDerivation <$> stackConfPackages)
+        TargetStackageOverride -> do
+          writeOutFile (stackYaml ^. syFilePath) (opts ^. optOutDerivation)
+            $ PP.overrideStackage
+            (stackConf ^. scResolver)
+            (opts ^. optNixpkgsRepository)
+            (view nodeDerivation <$> stackConfAllPackages)
+          writeOutFile (stackYaml ^. syFilePath) (opts ^. optOutStackYamlPackages)
+            $ PP.stackYamlPackages (view nodeDerivation <$> stackConfPackages)
 
     -- Generate Stackage packages from resolver
     OriginResolver stackResolver -> do
diff --git a/src/Runner/Cli.hs b/src/Runner/Cli.hs
--- a/src/Runner/Cli.hs
+++ b/src/Runner/Cli.hs
@@ -46,19 +46,20 @@
 makeLenses ''StackageOptions
 
 data Options = Options
-  { _optAllCabalHashesRepo  :: Maybe FilePath
-  , _optLtsHaskellRepo      :: Maybe FilePath
-  , _optOutStackagePackages :: FilePath
-  , _optOutStackageConfig   :: FilePath
-  , _optOutDerivation       :: FilePath
-  , _optDoCheckPackages     :: Bool
-  , _optDoHaddockPackages   :: Bool
-  , _optTweaks              :: Tweaks
-  , _optHackageDb           :: Maybe FilePath
-  , _optNixpkgsRepository   :: FilePath
-  , _optCompilerId          :: CompilerId
-  , _optPlatform            :: Platform
-  , _optConfigOrigin        :: ConfigOrigin
+  { _optAllCabalHashesRepo   :: Maybe FilePath
+  , _optLtsHaskellRepo       :: Maybe FilePath
+  , _optOutStackagePackages  :: FilePath
+  , _optOutStackageConfig    :: FilePath
+  , _optOutDerivation        :: FilePath
+  , _optOutStackYamlPackages :: FilePath
+  , _optDoCheckPackages      :: Bool
+  , _optDoHaddockPackages    :: Bool
+  , _optTweaks               :: Tweaks
+  , _optHackageDb            :: Maybe FilePath
+  , _optNixpkgsRepository    :: FilePath
+  , _optCompilerId           :: CompilerId
+  , _optPlatform             :: Platform
+  , _optConfigOrigin         :: ConfigOrigin
   } deriving (Show)
 
 makeLenses ''Options
@@ -79,6 +80,7 @@
   <*> outStackagePackages
   <*> outStackageConfig
   <*> outDerivation
+  <*> outStackYamlPackages
   <*> doCheckPackages
   <*> doHaddockPackages
   <*> tweaks
@@ -138,6 +140,14 @@
     <> metavar "NIX_FILE"
     <> help "path to output derivation"
     <> value "default.nix"
+    <> showDefaultWith id )
+
+outStackYamlPackages :: Parser FilePath
+outStackYamlPackages = option str
+  ( long "out-stack-yaml-packages"
+    <> metavar "NIX_FILE"
+    <> help "path to output stackage.yaml packages list"
+    <> value "stack-yaml-packages.nix"
     <> showDefaultWith id )
 
 doCheckPackages :: Parser Bool
diff --git a/src/Stack/Config.hs b/src/Stack/Config.hs
--- a/src/Stack/Config.hs
+++ b/src/Stack/Config.hs
@@ -6,7 +6,7 @@
 import Data.Bifunctor
 import Data.ByteString as BS
 import Data.Coerce
-import Data.Foldable as F
+import Data.List as L
 import Data.List.NonEmpty as NE
 import Data.Maybe
 import Data.Semigroup
@@ -72,22 +72,35 @@
 data StackConfig = StackConfig
   { _scResolver  :: StackResolver
   , _scPackages  :: NonEmpty StackPackage
+  , _scExtraDeps :: [StackPackage]
   } deriving (Eq, Ord, Show)
 
 makeLenses ''StackConfig
 
+scAllPackages :: Getter StackConfig (NonEmpty StackPackage)
+scAllPackages = to allPs
+  where
+    allPs sc = maybe ps ((<>) ps) (NE.nonEmpty ed)
+      where
+        ps = sc ^. scPackages
+        ed = sc ^. scExtraDeps
+
 fromYamlConfig :: Yaml.Config -> StackConfig
 fromYamlConfig c = StackConfig{..}
   where
     _scResolver = coerce $ c ^. cResolver
-    -- 'NE.nub' replicates Stack behavior of having a Set of packages rather than list
-    _scPackages = NE.nub $ F.foldl' (<>) nePackages yamlExtraDeps
+    -- 'nub' replicates Stack behavior of having a Set of packages rather than list
+    _scPackages  = NE.nub nePackages
+    _scExtraDeps = L.nub $ extraDeps ++ yamlExtraDeps
     nePackages = fromMaybe (pure defaultPackage)
-      $ fmap sconcat
-      $ NE.nonEmpty yamlPackages
-    yamlPackages   = fromYamlPackage packagesSimplePath False
+      $ NE.nonEmpty packages
+    -- yaml packages section can contain extra-deps
+    (extraDeps, packages) = L.partition (view spExtraDep) yamlPackages
+    yamlPackages   = L.concatMap NE.toList
+      $ fromYamlPackage packagesSimplePath False
       <$> fromMaybe mempty (c ^. cPackages)
-    yamlExtraDeps  = fromYamlPackage extraDepsSimplePath True
+    yamlExtraDeps  = L.concatMap NE.toList
+      $ fromYamlPackage extraDepsSimplePath True
       <$> fromMaybe mempty (c ^. cExtraDeps)
     defaultPackage = StackPackage (PlFilePath ".") False Nothing
 
@@ -177,5 +190,6 @@
       PlFilePath p -> PlFilePath $ stackYaml ^. syDirName </> p
       packageLocation -> packageLocation
     mkStackConfig = over (scPackages . traversed . spLocation) relativeToStackYaml
+      . over (scExtraDeps . traversed . spLocation) relativeToStackYaml
       . fromYamlConfig
   second mkStackConfig . decodeEither <$> BS.readFile (stackYaml ^. syFilePath)
diff --git a/stackage2nix.cabal b/stackage2nix.cabal
--- a/stackage2nix.cabal
+++ b/stackage2nix.cabal
@@ -1,5 +1,5 @@
 name:                stackage2nix
-version:             0.7.0
+version:             0.7.1
 synopsis:            Convert Stack files into Nix build instructions.
 homepage:            https://github.com/typeable/stackage2nix#readme
 license:             BSD3
diff --git a/test/Stack/ConfigSpec.hs b/test/Stack/ConfigSpec.hs
--- a/test/Stack/ConfigSpec.hs
+++ b/test/Stack/ConfigSpec.hs
@@ -51,6 +51,7 @@
   { _scResolver  = StackResolver "lts-10.0"
   , _scPackages  = NE.fromList
     [ StackPackage (PlFilePath ".") False Nothing]
+  , _scExtraDeps = []
   }
 
 packageDefaultBs :: ByteString
@@ -73,10 +74,11 @@
 
 packageSimpleListConf :: StackConfig
 packageSimpleListConf = StackConfig
-  { _scResolver = StackResolver "lts-10.0"
-  , _scPackages = NE.fromList
+  { _scResolver  = StackResolver "lts-10.0"
+  , _scPackages  = NE.fromList
     [ StackPackage (PlFilePath "client") False Nothing
     , StackPackage (PlFilePath "server") False Nothing ]
+  , _scExtraDeps = []
   }
 
 packageLocationsBs :: ByteString
@@ -102,11 +104,12 @@
 
 packageLocationsConf :: StackConfig
 packageLocationsConf = StackConfig
-  { _scResolver = StackResolver "lts-10.0"
-  , _scPackages = NE.fromList
+  { _scResolver  = StackResolver "lts-10.0"
+  , _scPackages  = NE.fromList
     [ StackPackage (PlFilePath "humble/package") False (Just "client")
-    , StackPackage (PlFilePath "humble/package") False (Just "server")
-    , StackPackage (PlUri $ stUri "https://example.com/foo/bar/baz-0.0.2.tar.gz") True (Just "extra")
+    , StackPackage (PlFilePath "humble/package") False (Just "server") ]
+  , _scExtraDeps =
+    [ StackPackage (PlUri $ stUri "https://example.com/foo/bar/baz-0.0.2.tar.gz") True (Just "extra")
     , StackPackage (PlRepo $ Repo (Vcs "git") "git@github.com:example/mega-repo" "6a86ee32e5b869a877151f74064572225e1a0000") True (Just "subdir1")
     , StackPackage (PlRepo $ Repo (Vcs "git") "git@github.com:example/mega-repo" "6a86ee32e5b869a877151f74064572225e1a0000") True (Just "subdir2")
     ]
@@ -122,10 +125,10 @@
 
 packageExtraDepsConf :: StackConfig
 packageExtraDepsConf = StackConfig
-  { _scResolver = StackResolver "lts-10.0"
-  , _scPackages = NE.fromList
-    [ StackPackage (PlFilePath ".") False Nothing
-    , StackPackage (PlIndex $ PackageIndex "acme-missiles-0.3" Nothing) True Nothing
+  { _scResolver  = StackResolver "lts-10.0"
+  , _scPackages  = NE.fromList [ StackPackage (PlFilePath ".") False Nothing ]
+  , _scExtraDeps =
+    [ StackPackage (PlIndex $ PackageIndex "acme-missiles-0.3" Nothing) True Nothing
     , StackPackage (PlIndex $ PackageIndex "humble-package-1" Nothing) True Nothing ]
   }
 
@@ -142,11 +145,12 @@
 
 packageMixedConf :: StackConfig
 packageMixedConf = StackConfig
-  { _scResolver = StackResolver "lts-10.0"
-  , _scPackages = NE.fromList
+  { _scResolver  = StackResolver "lts-10.0"
+  , _scPackages  = NE.fromList
     [ StackPackage (PlFilePath "client") False Nothing
-    , StackPackage (PlFilePath "server") False Nothing
-    , StackPackage (PlIndex $ PackageIndex "acme-missiles-0.3" Nothing) True Nothing
+    , StackPackage (PlFilePath "server") False Nothing ]
+  , _scExtraDeps =
+    [ StackPackage (PlIndex $ PackageIndex "acme-missiles-0.3" Nothing) True Nothing
     , StackPackage (PlIndex $ PackageIndex "humble-package-1" Nothing) True Nothing ]
   }
 
@@ -172,10 +176,10 @@
 
 packageExtraDepsNewConf :: StackConfig
 packageExtraDepsNewConf = StackConfig
-  { _scResolver = StackResolver "lts-10.0"
-  , _scPackages = NE.fromList
-    [ StackPackage (PlFilePath ".") False Nothing
-    , StackPackage (PlFilePath "vendor/lib") True Nothing
+  { _scResolver  = StackResolver "lts-10.0"
+  , _scPackages  = NE.fromList [ StackPackage (PlFilePath ".") False Nothing ]
+  , _scExtraDeps =
+    [ StackPackage (PlFilePath "vendor/lib") True Nothing
     , StackPackage (PlIndex $ PackageIndex "acme-missiles-0.3" Nothing) True Nothing
     , StackPackage (PlRepo $ Repo (Vcs "git") "git@github.com:yesodweb/wai" "2f8a8e1b771829f4a8a77c0111352ce45a14c30f") True (Just "auto-update")
     , StackPackage (PlRepo $ Repo (Vcs "git") "git@github.com:yesodweb/wai" "2f8a8e1b771829f4a8a77c0111352ce45a14c30f") True (Just "wai")
