From 2acb3d4f7a61f0a6d932624ccf11cd14d5dc1ff8 Mon Sep 17 00:00:00 2001 From: Clement Delafargue Date: Wed, 2 Oct 2019 11:02:54 +0200 Subject: Migrate to dhall 1.26.1 and merge types and terms --- .travis.yml | 2 +- dhall-1.21.0.nix | 22 ---------------- dhall-1.26.1.nix | 22 ++++++++++++++++ dhall/Addon.dhall | 6 +++++ dhall/Config.dhall | 62 ++++++++++++++++++++++++++------------------ dhall/addon/Addon.dhall | 1 - dhall/addon/Postgresql.dhall | 3 --- dhall/addon/functions.dhall | 1 - dhall/functions.dhall | 1 - dhall/mkConfig.dhall | 33 ----------------------- dhall/package.dhall | 1 + dhall/types.dhall | 1 - 12 files changed, 67 insertions(+), 88 deletions(-) delete mode 100644 dhall-1.21.0.nix create mode 100644 dhall-1.26.1.nix create mode 100644 dhall/Addon.dhall delete mode 100644 dhall/addon/Addon.dhall delete mode 100644 dhall/addon/Postgresql.dhall delete mode 100644 dhall/addon/functions.dhall delete mode 100644 dhall/functions.dhall delete mode 100644 dhall/mkConfig.dhall create mode 100644 dhall/package.dhall delete mode 100644 dhall/types.dhall diff --git a/.travis.yml b/.travis.yml index 3004369..4f5d09c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ sudo: false install: - nix-env -i python2.7-ansible python2.7-ansible-lint ShellCheck-0.7.0 - - nix-env -if ./dhall-1.21.0.nix + - nix-env -if ./dhall-1.26.1.nix # Check ansible version - ansible --version diff --git a/dhall-1.21.0.nix b/dhall-1.21.0.nix deleted file mode 100644 index e53369b..0000000 --- a/dhall-1.21.0.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ pkgs ? import {} }: 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" diff --git a/dhall-1.26.1.nix b/dhall-1.26.1.nix new file mode 100644 index 0000000..918a528 --- /dev/null +++ b/dhall-1.26.1.nix @@ -0,0 +1,22 @@ +{ pkgs ? import {} }: 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.26.1" "0sl4r3mfairgd6kn26hs1r1lkh8rn992grd73078rhqf5w90ag05" diff --git a/dhall/Addon.dhall b/dhall/Addon.dhall new file mode 100644 index 0000000..76d2c80 --- /dev/null +++ b/dhall/Addon.dhall @@ -0,0 +1,6 @@ +let Addon = < Postgresql : { name : Text, env_prefix : Text } > + +let postgresql = + Addon.Postgresql { name = "pg", env_prefix = "POSTGRESQL_ADDON" } + +in { Type = Addon, postgresql = postgresql } diff --git a/dhall/Config.dhall b/dhall/Config.dhall index 5b7eab2..1b9388e 100644 --- a/dhall/Config.dhall +++ b/dhall/Config.dhall @@ -1,26 +1,38 @@ -let Addon = ./addon/Addon.dhall +let Addon = (./Addon.dhall).Type -in λ(Environment : Type) - → { clever_app : - Text - , clever_orga : - Text - , clever_secret : - Text - , clever_token : - Text - , clever_syslog_server : - Optional Text - , clever_domain : - Optional Text - , clever_app_tasks_file : - Optional Text - , clever_haskell_entry_point : - Optional Text - , clever_disable_metrics : - Bool - , clever_addons : - List Addon - , clever_env : - Environment - } +let Vault = ./Vault.dhall + +let Config = + λ(Environment : Type) + → { clever_app : Text + , clever_orga : Text + , clever_secret : Text + , clever_token : Text + , clever_syslog_server : Optional Text + , clever_domain : Optional Text + , clever_app_tasks_file : Optional Text + , clever_haskell_entry_point : Optional Text + , clever_disable_metrics : Bool + , clever_addons : List Addon + , clever_env : Environment + } + +let mkConfig = + λ(vault : Vault) + → λ(app : Text) + → λ(organization : Text) + → { clever_app = app + , clever_orga = organization + , clever_secret = vault.secret + , clever_token = vault.token + , clever_syslog_server = None Text + , clever_domain = None Text + , clever_app_tasks_file = None Text + , clever_haskell_entry_point = None Text + , clever_disable_metrics = False + , clever_addons = [] : List Addon + , clever_env = {=} + } + : Config {} + +in { Type = Config, mkConfig = mkConfig } diff --git a/dhall/addon/Addon.dhall b/dhall/addon/Addon.dhall deleted file mode 100644 index 2eb781c..0000000 --- a/dhall/addon/Addon.dhall +++ /dev/null @@ -1 +0,0 @@ -< Postgresql : { name : Text, env_prefix : Text } > diff --git a/dhall/addon/Postgresql.dhall b/dhall/addon/Postgresql.dhall deleted file mode 100644 index ed6b411..0000000 --- a/dhall/addon/Postgresql.dhall +++ /dev/null @@ -1,3 +0,0 @@ -let addon = ./Addon.dhall - -in addon.Postgresql { name = "pg", env_prefix = "POSTGRESQL_ADDON" } diff --git a/dhall/addon/functions.dhall b/dhall/addon/functions.dhall deleted file mode 100644 index 65979ac..0000000 --- a/dhall/addon/functions.dhall +++ /dev/null @@ -1 +0,0 @@ -{ Postgresql = ./Postgresql.dhall } diff --git a/dhall/functions.dhall b/dhall/functions.dhall deleted file mode 100644 index f047c19..0000000 --- a/dhall/functions.dhall +++ /dev/null @@ -1 +0,0 @@ -{ Addon = ./addon/functions.dhall, mkConfig = ./mkConfig.dhall } diff --git a/dhall/mkConfig.dhall b/dhall/mkConfig.dhall deleted file mode 100644 index d2ec034..0000000 --- a/dhall/mkConfig.dhall +++ /dev/null @@ -1,33 +0,0 @@ -let Config = ./Config.dhall - -let Vault = ./Vault.dhall - -let Addon = ./addon/Addon.dhall - -in λ(vault : Vault) - → λ(app : Text) - → λ(organization : Text) - → { clever_app = - app - , clever_orga = - organization - , clever_secret = - vault.secret - , clever_token = - vault.token - , clever_syslog_server = - None Text - , clever_domain = - None Text - , clever_app_tasks_file = - None Text - , clever_haskell_entry_point = - None Text - , clever_disable_metrics = - False - , clever_addons = - [] : List Addon - , clever_env = - {=} - } - : Config {} diff --git a/dhall/package.dhall b/dhall/package.dhall new file mode 100644 index 0000000..c653ddb --- /dev/null +++ b/dhall/package.dhall @@ -0,0 +1 @@ +{ Addon = ./Addon.dhall, Config = ./Config.dhall, Vault = ./Vault.dhall } diff --git a/dhall/types.dhall b/dhall/types.dhall deleted file mode 100644 index ab153d2..0000000 --- a/dhall/types.dhall +++ /dev/null @@ -1 +0,0 @@ -{ Vault = ./Vault.dhall, Addon = ./addon/Addon.dhall, Config = ./Config.dhall } -- cgit v1.2.3