mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 07:13:23 +01:00
6dac8e6817
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.
30 lines
787 B
Nix
30 lines
787 B
Nix
{ buildDhallPackage, lib }:
|
|
|
|
# This is a minor variation on `buildDhallPackage` that splits the `code`
|
|
# argument into `src` and `file` in such a way that you can easily override
|
|
# the `file`
|
|
#
|
|
# This function is used by `dhall-to-nixpkgs` when given a directory
|
|
lib.makePackageOverridable
|
|
( { # Arguments passed through to `buildDhallPackage`
|
|
name
|
|
, dependencies ? []
|
|
, source ? false
|
|
|
|
, 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;
|
|
|
|
code = "${src}/${file}";
|
|
|
|
}
|
|
// lib.optionalAttrs document { documentationRoot = src; }
|
|
)
|
|
)
|
|
|