18 lines
447 B
Nix
18 lines
447 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 pkgs.lib)
|