1 /* `dhallToNix` is a utility function to convert expressions in the Dhall
2 configuration language to their corresponding Nix expressions.
5 dhallToNix "{ foo = 1, bar = True }"
6 => { foo = 1; bar = true; }
7 dhallToNix "λ(x : Bool) → x == False"
9 dhallToNix "λ(x : Bool) → x == False" false
12 See https://hackage.haskell.org/package/dhall-nix/docs/Dhall-Nix.html for
15 Note that this uses "import from derivation", meaning that Nix will perform
16 a build during the evaluation phase if you use this `dhallToNix` utility
18 { stdenv, dhall-nix }:
23 file = builtins.toFile "dhall-expression" code;
25 drv = stdenv.mkDerivation {
26 name = "dhall-compiled.nix";
29 dhall-to-nix <<< "${file}" > $out
32 buildInputs = [ dhall-nix ];