diff --git a/default.nix b/default.nix index 1787154..c945801 100644 --- a/default.nix +++ b/default.nix @@ -12,4 +12,8 @@ dhall-bash-simple = import ./dhall-bash-simple.nix { inherit pkgs; }; + + dhall-nix-simple = import ./dhall-nix-simple.nix { + inherit pkgs; + }; } diff --git a/dhall-nix-simple.nix b/dhall-nix-simple.nix new file mode 100644 index 0000000..3c12b60 --- /dev/null +++ b/dhall-nix-simple.nix @@ -0,0 +1,21 @@ +{ pkgs ? import {} }: + +pkgs.stdenv.mkDerivation rec { + name = "dhall-nix-simple"; + + src = if pkgs.stdenv.isDarwin + then throw "dhall nix only released for linux" + else pkgs.fetchurl { + url = "https://github.com/dhall-lang/dhall-haskell/releases/download/1.26.0/dhall-nix-1.1.8-x86_64-linux.tar.bz2"; + sha256 = "0zb1fl5bzaqfjg95m4znw3dcjkndl0nk6c70qd9pbrb4d2xch6s8"; + }; + + installPhase = '' + mkdir -p $out/bin + DHALL_TO_NIX=$out/bin/dhall-to-nix + install -D -m555 -T dhall-to-nix $DHALL_TO_NIX + + mkdir -p $out/etc/bash_completion.d/ + $DHALL_TO_NIX --bash-completion-script $DHALL_TO_NIX > $out/etc/bash_completion.d/dhall-to-nix-completion.bash + ''; +} diff --git a/test.bash b/test.bash index 05283df..c65802b 100755 --- a/test.bash +++ b/test.bash @@ -17,5 +17,6 @@ function test_exe () { test_exe dhall; test_exe dhall-to-json; test_exe dhall-to-bash; +test_exe dhall-to-nix; exit $ERRORS;