From: Clement Delafargue Date: Wed, 2 Oct 2019 09:02:54 +0000 (+0200) Subject: Migrate to dhall 1.26.1 and merge types and terms X-Git-Tag: v2.0-test-clementd X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=2acb3d4f7a61f0a6d932624ccf11cd14d5dc1ff8;p=github%2Ffretlink%2Fansible-clever.git Migrate to dhall 1.26.1 and merge types and terms --- 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.26.1.nix similarity index 87% rename from dhall-1.21.0.nix rename to dhall-1.26.1.nix index e53369b..918a528 100644 --- a/dhall-1.21.0.nix +++ b/dhall-1.26.1.nix @@ -19,4 +19,4 @@ let ''; }; in - mkVersion "1.21.0" "0x7q6v1y62fq6724kx1hcfp1fcqv3lbv33ji6jzfd5y316a31r77" + 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 }