dhall-nix-lib/dhallToNix.nix

18 lines
438 B
Nix

{pkgs ? import <nixpkgs> {}}: code: let
codeString = builtins.toString code;
file =
if builtins.isPath code
then code
else builtins.toFile "dhall-expr" codeString;
drv = pkgs.stdenvNoCC.mkDerivation {
name = "dhall-expr-as-nix";
src = ./.;
buildCommand = ''
cd $src
dhall-to-nix < ${file} > $out
'';
nativeBuildInputs = [pkgs.dhall-nix];
};
in
import "${drv}" (import ./runtime.nix)