Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
27 lines
820 B
Nix
27 lines
820 B
Nix
{ dhallPackages, dhallPackageToNix }:
|
|
|
|
# `dhallDirectoryToNix is a utility function to take a directory of Dhall files
|
|
# and read them in as a Nix expression.
|
|
#
|
|
# This function is similar to `dhallToNix`, but takes a Nixpkgs Dhall package
|
|
# as input instead of raw Dhall code.
|
|
#
|
|
# Note that this uses "import from derivation" (IFD), meaning that Nix will
|
|
# perform a build during the evaluation phase if you use this
|
|
# `dhallDirectoryToNix` utility. It is not possible to use
|
|
# `dhallDirectoryToNix` in Nixpkgs, since the Nixpkgs Hydra doesn't allow IFD.
|
|
|
|
{
|
|
src,
|
|
# The file to import, relative to the src root directory
|
|
file ? "package.dhall",
|
|
}@args:
|
|
|
|
let
|
|
generatedPkg = dhallPackages.generateDhallDirectoryPackage args;
|
|
|
|
builtPkg = dhallPackages.callPackage generatedPkg { };
|
|
|
|
in
|
|
dhallPackageToNix builtPkg
|