1 { dhallPackages, dhallPackageToNix}:
3 # `dhallDirectoryToNix is a utility function to take a directory of Dhall files
4 # and read them in as a Nix expression.
6 # This function is similar to `dhallToNix`, but takes a Nixpkgs Dhall package
7 # as input instead of raw Dhall code.
9 # Note that this uses "import from derivation" (IFD), meaning that Nix will
10 # perform a build during the evaluation phase if you use this
11 # `dhallDirectoryToNix` utility. It is not possible to use
12 # `dhallDirectoryToNix` in Nixpkgs, since the Nixpkgs Hydra doesn't allow IFD.
15 , # The file to import, relative to the src root directory
16 file ? "package.dhall"
20 generatedPkg = dhallPackages.generateDhallDirectoryPackage args;
22 builtPkg = dhallPackages.callPackage generatedPkg { };
25 dhallPackageToNix builtPkg