nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ buildDhallPackage, lib }:
2
3# This is a minor variation on `buildDhallPackage` that splits the `code`
4# argument into `src` and `file` in such a way that you can easily override
5# the `file`
6#
7# This function is used by `dhall-to-nixpkgs` when given a directory
8lib.makePackageOverridable (
9 {
10 # Arguments passed through to `buildDhallPackage`
11 name,
12 dependencies ? [ ],
13 source ? false,
14
15 src,
16 # The file to import, relative to the root directory
17 file ? "package.dhall",
18 # Set to `true` to generate documentation for the package
19 document ? false,
20 }:
21
22 buildDhallPackage (
23 {
24 inherit name dependencies source;
25
26 code = "${src}/${file}";
27
28 }
29 // lib.optionalAttrs document { documentationRoot = "${src}"; }
30 )
31)