2019-09-24 16:22:05 +02:00
|
|
|
{ pkgs ? import <nixpkgs> {} }:
|
|
|
|
|
2020-03-29 22:18:25 +02:00
|
|
|
let
|
|
|
|
release = import ./release.nix;
|
|
|
|
in
|
|
|
|
|
2019-09-24 16:22:05 +02:00
|
|
|
pkgs.stdenv.mkDerivation rec {
|
|
|
|
name = "dhall-nix-simple";
|
|
|
|
|
|
|
|
src = if pkgs.stdenv.isDarwin
|
2019-09-25 21:08:38 +02:00
|
|
|
then pkgs.fetchurl {
|
2020-03-29 22:18:25 +02:00
|
|
|
url = release.dhall-nix-darwin.url;
|
|
|
|
sha256 = release.dhall-nix-darwin.hash;
|
2019-09-25 21:08:38 +02:00
|
|
|
}
|
2019-09-24 16:22:05 +02:00
|
|
|
else pkgs.fetchurl {
|
2020-03-29 22:18:25 +02:00
|
|
|
url = release.dhall-nix-linux.url;
|
|
|
|
sha256 = release.dhall-nix-linux.hash;
|
2019-09-24 16:22:05 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
}
|