nixpkgs/dhallToNix.nix

22 lines
460 B
Nix

let
sources = import ./nix/sources.nix;
pkgs = import sources.nixpkgs { };
withPkg = pkgs.lib.callPackageWith pkgs;
dhall = withPkg sources.easy-dhall-nix { };
in code:
let
file = builtins.toFile "dhall-expr" code;
drv = pkgs.stdenv.mkDerivation {
name = "dhall-expr-as-nix";
buildCommand = ''
dhall-to-nix <<< "${file}" > $out
'';
buildInputs = [ dhall.dhall-nix-simple ];
};
in
import "${drv}"