Add buildDhall*Package support for generating documentation

The `buildDhall{Directory,GitHub}Package` utilities now take an
optional `document` argument for generating documentation using
`dhall-docs`.  The documentation is stored underneath the `./docs`
subdirectory of the build product.
This commit is contained in:
Gabriel Gonzalez
2020-12-01 15:30:52 +01:00
committed by Emery Hemingway
parent 86b651f169
commit 6dac8e6817
4 changed files with 57 additions and 29 deletions
@@ -14,12 +14,17 @@ lib.makePackageOverridable
, src
, # The file to import, relative to the root directory
file ? "package.dhall"
# Set to `true` to generate documentation for the package
, document ? false
}:
buildDhallPackage {
inherit name dependencies source;
buildDhallPackage
( { inherit name dependencies source;
code = "${src}/${file}";
}
code = "${src}/${file}";
}
// lib.optionalAttrs document { documentationRoot = src; }
)
)