2020-05-10 04:16:06 +02:00
|
|
|
{ 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
|
2020-11-01 21:26:33 +01:00
|
|
|
lib.makePackageOverridable
|
2020-05-10 04:16:06 +02:00
|
|
|
( { # Arguments passed through to `buildDhallPackage`
|
|
|
|
name
|
|
|
|
, dependencies ? []
|
|
|
|
, source ? false
|
|
|
|
|
|
|
|
, src
|
|
|
|
, # The file to import, relative to the root directory
|
|
|
|
file ? "package.dhall"
|
2020-11-26 07:02:26 +01:00
|
|
|
# Set to `true` to generate documentation for the package
|
|
|
|
, document ? false
|
2020-05-10 04:16:06 +02:00
|
|
|
}:
|
|
|
|
|
2020-11-26 07:02:26 +01:00
|
|
|
buildDhallPackage
|
|
|
|
( { inherit name dependencies source;
|
2020-05-10 04:16:06 +02:00
|
|
|
|
2020-11-26 07:02:26 +01:00
|
|
|
code = "${src}/${file}";
|
|
|
|
|
|
|
|
}
|
2022-03-02 00:34:21 +01:00
|
|
|
// lib.optionalAttrs document { documentationRoot = "${src}"; }
|
2020-11-26 07:02:26 +01:00
|
|
|
)
|
2020-05-10 04:16:06 +02:00
|
|
|
)
|