install:
# Install ansible
- nix-env -i python2.7-ansible python2.7-ansible-lint
- - nix-env -if ./dhall-1.18.0.nix
+ - nix-env -if ./dhall-1.21.0.nix
# Check ansible version
- ansible --version
+++ /dev/null
-{ pkgs ? import <nixpkgs> {} }: with pkgs;
-
-stdenv.mkDerivation rec {
- name = "dhall-${version}";
- version = "1.18.0";
- phases = [ "installPhase "];
- src = fetchurl {
- url = "https://github.com/dhall-lang/dhall-haskell/releases/download/${version}/dhall-${version}-x86_64-linux.tar.bz2";
- sha256 = "0jvw6ss96xifb21mzpvfjzvaffcnpj0jhpc4rd36cl2r22800qgx";
- };
- installPhase = ''
- mkdir -p $out/bin
- tar -xjf $src
- mv bin/dhall $out/bin/
- '';
-}
--- /dev/null
+{ pkgs ? import <nixpkgs> {} }: with pkgs;
+
+let
+ mkVersion =
+ version: sha256:
+ stdenv.mkDerivation {
+ name = "dhall-${version}";
+ inherit version;
+ src = fetchurl {
+ url = "https://github.com/dhall-lang/dhall-haskell/releases/download/${version}/dhall-${version}-x86_64-linux.tar.bz2";
+ inherit sha256;
+ };
+ unpackPhase = ''
+ tar -xjf $src
+ '';
+ installPhase = ''
+ mkdir -p $out/bin
+ mv bin/dhall $out/bin/
+ '';
+ };
+in
+ mkVersion "1.21.0" "0x7q6v1y62fq6724kx1hcfp1fcqv3lbv33ji6jzfd5y316a31r77"
- let Plugin = ./Plugin.dhall
+let Plugin = ./Plugin.dhall
-in let config = constructors ./Config.dhall
+let config = ./Config.dhall
in { name =
- "correlation-id"
- , config =
- config.CorrelationId
- { header_name = "X-correl", echo_downstream = True }
- }
- : Plugin
+ "correlation-id"
+ , config =
+ config.CorrelationId
+ { header_name = "X-correl", echo_downstream = True }
+ }
+ : Plugin
- let Plugin = ./Plugin.dhall
+let Plugin = ./Plugin.dhall
-in let config = constructors ./Config.dhall
+let config = ./Config.dhall
in λ(whiteList : Text)
- → { name =
- "ip-restriction"
- , config =
- config.IPRestriction { whitelist = whiteList }
- }
- : Plugin
+ → { name =
+ "ip-restriction"
+ , config =
+ config.IPRestriction { whitelist = whiteList }
+ }
+ : Plugin
- let Plugin = ./Plugin.dhall
+let Plugin = ./Plugin.dhall
-in let config = constructors ./Config.dhall
+let config = ./Config.dhall
in λ(statusCode : Natural)
- → λ(contentType : Text)
- → λ(body : Text)
- → { name =
- "request-termination"
- , config =
- config.RequestTermination
- { status_code =
- statusCode
- , content_type =
- contentType
- , body =
- body
- }
- }
- : Plugin
+ → λ(contentType : Text)
+ → λ(body : Text)
+ → { name =
+ "request-termination"
+ , config =
+ config.RequestTermination
+ { status_code =
+ statusCode
+ , content_type =
+ contentType
+ , body =
+ body
+ }
+ }
+ : Plugin
let Plugin = ./Plugin.dhall
-in let config = constructors ./Config.dhall
+let config = ./Config.dhall
- in λ(header : Text)
- → { name =
- "request-transformer"
- , config =
- config.RequestTransformer { add = { headers = [ header ] } }
- }
- : Plugin
\ No newline at end of file
+in λ(header : Text)
+ → { name =
+ "request-transformer"
+ , config =
+ config.RequestTransformer { add = { headers = [ header ] } }
+ }
+ : Plugin