nixpkgs/pkgs/development/interpreters/dhall/build-dhall-directory-package.nix
Akshay Mankar f30dbd05fe
buildDhallDirectoryPackage: Stringify src for documentationRoot (#162401)
The `src` is supposed to be a path, but when `documentationRoot` is provided
with a path, it errors with:

generators.mkValueStringDefault: this value is not supported: "<nix-store-path>"

Making it a string fixes this error.
2022-03-01 15:34:21 -08:00

30 lines
791 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}"; }
)
)