2020-01-24 15:48:58 +01:00
|
|
|
{ pkgs ? import <nixpkgs> {} }:
|
|
|
|
|
2020-03-29 22:18:25 +02:00
|
|
|
let
|
|
|
|
release = import ./release.nix;
|
|
|
|
in
|
|
|
|
|
2020-01-24 15:48:58 +01:00
|
|
|
pkgs.stdenv.mkDerivation rec {
|
|
|
|
name = "dhall-yaml-simple";
|
|
|
|
|
|
|
|
src = if pkgs.stdenv.isDarwin
|
|
|
|
then pkgs.fetchurl {
|
2020-03-29 22:18:25 +02:00
|
|
|
url = release.dhall-yaml-darwin.url;
|
|
|
|
sha256 = release.dhall-yaml-darwin.hash;
|
2020-01-24 15:48:58 +01:00
|
|
|
}
|
|
|
|
else pkgs.fetchurl {
|
2020-03-29 22:18:25 +02:00
|
|
|
url = release.dhall-yaml-linux.url;
|
|
|
|
sha256 = release.dhall-yaml-linux.hash;
|
2020-01-24 15:48:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
DHALL_TO_YAML=$out/bin/dhall-to-yaml-ng
|
|
|
|
install -D -m555 -T dhall-to-yaml-ng $DHALL_TO_YAML
|
|
|
|
|
|
|
|
mkdir -p $out/etc/bash_completion.d/
|
|
|
|
$DHALL_TO_YAML --bash-completion-script $DHALL_TO_YAML > $out/etc/bash_completion.d/dhall-to-yaml-completion.bash
|
|
|
|
'';
|
|
|
|
}
|