Users can now supply additional headers for URL imports using the new `using` keyword, like this: ```haskell http://example.com using ./headers ``` ... where `./headers` must be a value of type: ```haskell { header : Text, value : Text } ``` The argument to `using` must be an import (such as a file, URL, or env import) and cannot be an inline Dhall expression. There are two reasons why: * The header expression is resolved, type-checked, and normalized in a separate phase preceding the import of the corresponding URL so it does not have access to bound variables in scop * This restriction greatly simplifies the implementation Also, headers are automatically forwarded to relative imports, so if you import a URL like this: ```haskell http://example.com using ./headers ``` ... and that serves a file like: ```haskell ./foo ``` ... then Dhall will import `http://example.com/foo` using the same `./headers`.
26 lines
961 B
Nix
26 lines
961 B
Nix
{ mkDerivation, ansi-wl-pprint, base, bytestring, case-insensitive
|
|
, charset, containers, http-client, http-client-tls, lens
|
|
, neat-interpolation, optparse-generic, parsers, stdenv
|
|
, system-fileio, system-filepath, tasty, tasty-hunit, text
|
|
, text-format, transformers, trifecta, unordered-containers, vector
|
|
}:
|
|
mkDerivation {
|
|
pname = "dhall";
|
|
version = "1.3.0";
|
|
src = ./.;
|
|
isLibrary = true;
|
|
isExecutable = true;
|
|
libraryHaskellDepends = [
|
|
ansi-wl-pprint base bytestring case-insensitive charset containers
|
|
http-client http-client-tls lens neat-interpolation parsers
|
|
system-fileio system-filepath text text-format transformers
|
|
trifecta unordered-containers vector
|
|
];
|
|
executableHaskellDepends = [ base optparse-generic text trifecta ];
|
|
testHaskellDepends = [
|
|
base neat-interpolation tasty tasty-hunit text vector
|
|
];
|
|
description = "A configuration language guaranteed to terminate";
|
|
license = stdenv.lib.licenses.bsd3;
|
|
}
|