From de2b7839ae0266255a0b693ce15d768e3dc47a61 Mon Sep 17 00:00:00 2001 From: justinwoo Date: Mon, 19 Aug 2019 10:57:37 +0300 Subject: [PATCH] add dhall json apparently this is not yet merged into dhall itself --- .envrc | 1 - default.nix | 2 ++ dhall-json-simple.nix | 24 ++++++++++++++++++++++++ test.bash | 1 + 4 files changed, 27 insertions(+), 1 deletion(-) delete mode 100644 .envrc create mode 100644 dhall-json-simple.nix diff --git a/.envrc b/.envrc deleted file mode 100644 index be81fed..0000000 --- a/.envrc +++ /dev/null @@ -1 +0,0 @@ -eval "$(lorri direnv)" \ No newline at end of file diff --git a/default.nix b/default.nix index 5d5170c..4c012a5 100644 --- a/default.nix +++ b/default.nix @@ -3,5 +3,7 @@ { dhall-simple = import ./dhall-simple.nix { inherit pkgs; }; + dhall-json-simple = import ./dhall-json-simple.nix { inherit pkgs; }; + dhall-bash-simple = import ./dhall-bash-simple.nix { inherit pkgs; }; } diff --git a/dhall-json-simple.nix b/dhall-json-simple.nix new file mode 100644 index 0000000..983d25a --- /dev/null +++ b/dhall-json-simple.nix @@ -0,0 +1,24 @@ +{ pkgs ? import {} }: + +pkgs.stdenv.mkDerivation rec { + name = "dhall-json-simple"; + + src = if pkgs.stdenv.isDarwin + then pkgs.fetchurl { + url = "https://github.com/dhall-lang/dhall-haskell/releases/download/1.25.0/dhall-json-1.4.0-x86_64-macos.tar.bz2"; + sha256 = "0427xy59mzyrz978l36x0ha610bpckg14m3svkvg8hipvblgh19r"; + } + else pkgs.fetchurl { + url = "https://github.com/dhall-lang/dhall-haskell/releases/download/1.25.0/dhall-json-1.4.0-x86_64-linux.tar.bz2"; + sha256 = "14apqq0dj3lmm8yccygf8bb27scxjfkjkmr8zgnwb98znr51gfwn"; + }; + + installPhase = '' + mkdir -p $out/bin + DHALL_TO_JSON=$out/bin/dhall-to-json + install -D -m555 -T dhall-to-json $DHALL_TO_JSON + + mkdir -p $out/etc/bash_completion.d/ + $DHALL_TO_JSON --bash-completion-script $DHALL_TO_JSON > $out/etc/bash_completion.d/dhall-to-json-completion.bash + ''; +} diff --git a/test.bash b/test.bash index d7da705..05283df 100755 --- a/test.bash +++ b/test.bash @@ -15,6 +15,7 @@ function test_exe () { } test_exe dhall; +test_exe dhall-to-json; test_exe dhall-to-bash; exit $ERRORS;