diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,9 @@
+1.2.11
+
+* [Add new `--preserve-header` option](https://github.com/dhall-lang/dhall-haskell/pull/2410)
+* Builds against newer dependencies
+  * [`aeson-2.1`](https://github.com/dhall-lang/dhall-haskell/pull/2424)
+
 1.2.10
 
 * Build against `dhall-1.41`
diff --git a/dhall-yaml.cabal b/dhall-yaml.cabal
--- a/dhall-yaml.cabal
+++ b/dhall-yaml.cabal
@@ -1,5 +1,5 @@
 Name: dhall-yaml
-Version: 1.2.10
+Version: 1.2.11
 Cabal-Version: >=1.10
 Build-Type: Simple
 License: GPL-3
@@ -34,7 +34,7 @@
         HsYAML                    >= 0.2       && < 0.3 ,
         HsYAML-aeson              >= 0.2       && < 0.3 ,
         base                      >= 4.11.0.0  && < 5   ,
-        aeson                     >= 1.0.0.0   && < 2.1 ,
+        aeson                     >= 1.0.0.0   && < 2.2 ,
         bytestring                                < 0.12,
         dhall                     >= 1.31.0    && < 1.42,
         dhall-json                >= 1.6.0     && < 1.8 ,
diff --git a/src/Dhall/Yaml.hs b/src/Dhall/Yaml.hs
--- a/src/Dhall/Yaml.hs
+++ b/src/Dhall/Yaml.hs
@@ -12,19 +12,21 @@
 import Data.ByteString      (ByteString)
 import Data.ByteString.Lazy (toStrict)
 import Data.Text            (Text)
-import Dhall.JSON           (SpecialDoubleMode (..), codeToValue)
+import Dhall.JSON           (SpecialDoubleMode (..), codeToHeaderAndValue)
 import Dhall.JSON.Yaml      (Options (..))
+import Dhall.Parser         (Header (..))
 
 import qualified Data.Aeson
 import qualified Data.ByteString
-import qualified Data.Char        as Char
-import qualified Data.Text        as Text
+import qualified Data.Char          as Char
+import qualified Data.Text          as Text
+import qualified Data.Text.Encoding
 import qualified Data.Vector
-import qualified Data.YAML        as Y
+import qualified Data.YAML          as Y
 import qualified Data.YAML.Aeson
-import qualified Data.YAML.Event  as YE
-import qualified Data.YAML.Schema as YS
-import qualified Data.YAML.Token  as YT
+import qualified Data.YAML.Event    as YE
+import qualified Data.YAML.Schema   as YS
+import qualified Data.YAML.Token    as YT
 import qualified Dhall
 import qualified Dhall.JSON.Yaml
 
@@ -40,12 +42,18 @@
 
   let explaining = if explain then Dhall.detailed else id
 
-  json <- omission <$> explaining (codeToValue conversion UseYAMLEncoding mFilePath code)
+  let adapt (header, value) = (header, omission value)
 
+  (Header comment, json) <- adapt <$> explaining (codeToHeaderAndValue conversion UseYAMLEncoding mFilePath code)
+
+  let suffix
+          | preserveHeader = Data.Text.Encoding.encodeUtf8 comment
+          | otherwise      = mempty
+
   let header =
           if noEdit
-          then Dhall.JSON.Yaml.generatedCodeNotice
-          else mempty
+          then Dhall.JSON.Yaml.generatedCodeNotice <> suffix
+          else suffix
 
   return $ header <> jsonToYaml json documents quoted
 
diff --git a/tasty/Main.hs b/tasty/Main.hs
--- a/tasty/Main.hs
+++ b/tasty/Main.hs
@@ -69,6 +69,10 @@
             TestBoth
         , testYamlToDhall
             "./tasty/data/mergify"
+        , testDhallToYaml
+            Dhall.JSON.Yaml.defaultOptions{ preserveHeader = True }
+            "./tasty/data/preserve-header"
+            TestBoth
         ]
 
 testDhallToYaml :: Options -> String -> TestScope -> TestTree
diff --git a/tasty/data/preserve-header.dhall b/tasty/data/preserve-header.dhall
new file mode 100644
--- /dev/null
+++ b/tasty/data/preserve-header.dhall
@@ -0,0 +1,6 @@
+-- Test header preservation
+--
+-- Line comments strip the leading `--`
+{- Block comments include the surrounding `{-` and `-}`
+  -}
+1
diff --git a/tasty/data/preserve-header.yaml b/tasty/data/preserve-header.yaml
new file mode 100644
--- /dev/null
+++ b/tasty/data/preserve-header.yaml
@@ -0,0 +1,6 @@
+# Test header preservation
+#
+# Line comments strip the leading `--`
+#{- Block comments include the surrounding `{-` and `-}`
+#  -}
+1
