nixpkgs/pkgs/dhallToNix.nix

22 lines
460 B
Nix
Raw Normal View History

2020-02-13 21:50:49 +00:00
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}"