dhall-nix-lib/dhallToNix.nix

19 lines
438 B
Nix
Raw Normal View History

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