dhallDirectoryToNix: add this utility function

+27
+25
pkgs/build-support/dhall/directory-to-nix.nix
··· 1 + { dhallPackages, dhallPackageToNix}: 2 + 3 + # `dhallDirectoryToNix is a utility function to take a directory of Dhall files 4 + # and read them in as a Nix expression. 5 + # 6 + # This function is similar to `dhallToNix`, but takes a Nixpkgs Dhall package 7 + # as input instead of raw Dhall code. 8 + # 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. 13 + 14 + { src 15 + , # The file to import, relative to the src root directory 16 + file ? "package.dhall" 17 + }@args: 18 + 19 + let 20 + generatedPkg = dhallPackages.generateDhallDirectoryPackage args; 21 + 22 + builtPkg = dhallPackages.callPackage generatedPkg { }; 23 + 24 + in 25 + dhallPackageToNix builtPkg
+2
pkgs/top-level/all-packages.nix
··· 301 301 302 302 crow-translate = libsForQt5.callPackage ../applications/misc/crow-translate { }; 303 303 304 + dhallDirectoryToNix = callPackage ../build-support/dhall/directory-to-nix.nix { }; 305 + 304 306 dhallPackageToNix = callPackage ../build-support/dhall/package-to-nix.nix { }; 305 307 306 308 dhallToNix = callPackage ../build-support/dhall/to-nix.nix { };