···11+{ dhallPackages, dhallPackageToNix}:
22+33+# `dhallDirectoryToNix is a utility function to take a directory of Dhall files
44+# and read them in as a Nix expression.
55+#
66+# This function is similar to `dhallToNix`, but takes a Nixpkgs Dhall package
77+# as input instead of raw Dhall code.
88+#
99+# Note that this uses "import from derivation" (IFD), meaning that Nix will
1010+# perform a build during the evaluation phase if you use this
1111+# `dhallDirectoryToNix` utility. It is not possible to use
1212+# `dhallDirectoryToNix` in Nixpkgs, since the Nixpkgs Hydra doesn't allow IFD.
1313+1414+{ src
1515+, # The file to import, relative to the src root directory
1616+ file ? "package.dhall"
1717+}@args:
1818+1919+let
2020+ generatedPkg = dhallPackages.generateDhallDirectoryPackage args;
2121+2222+ builtPkg = dhallPackages.callPackage generatedPkg { };
2323+2424+in
2525+ dhallPackageToNix builtPkg