2019-08-19 09:57:37 +02:00
|
|
|
{ pkgs ? import <nixpkgs> {} }:
|
|
|
|
|
|
|
|
pkgs.stdenv.mkDerivation rec {
|
|
|
|
name = "dhall-json-simple";
|
|
|
|
|
|
|
|
src = if pkgs.stdenv.isDarwin
|
2019-09-12 15:50:36 +02:00
|
|
|
then pkgs.fetchurl {
|
2019-12-19 06:04:31 +01:00
|
|
|
url = "https://github.com/dhall-lang/dhall-haskell/releases/download/1.28.0/dhall-json-1.6.0-x86_64-macos.tar.bz2";
|
|
|
|
sha256 = "1zj4h1hiq62lvkn8ic5rhzfgiachgq75s74zv94nkfi96xv994ih";
|
2019-09-12 15:50:36 +02:00
|
|
|
}
|
|
|
|
else pkgs.fetchurl {
|
2019-12-19 06:04:31 +01:00
|
|
|
url = "https://github.com/dhall-lang/dhall-haskell/releases/download/1.28.0/dhall-json-1.6.0-x86_64-linux.tar.bz2";
|
|
|
|
sha256 = "19xxlsn2xbhri6mvznas8hyk90l47w3lqf6y3lhmyaaqz81pd4dr";
|
2019-09-12 15:50:36 +02:00
|
|
|
};
|
2019-08-19 09:57:37 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
}
|