commit 87406a76409c16bbd7511e397cfc52e1c58954e3 Author: justinwoo Date: Sat Dec 8 13:34:40 2018 +0200 init diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d93cf9a --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +default: test + +test: + nix-shell -A shell --pure --run './test.bash' diff --git a/README.md b/README.md new file mode 100644 index 0000000..b697fd6 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# Easy Dhall Nix + +[![Build Status](https://travis-ci.org/justinwoo/easy-dhall-nix.svg?branch=master)](https://travis-ci.org/justinwoo/easy-dhall-nix) + +Derivations for easily downloading Nix binaries and putting them to use. + +## Trial + +You cn get an appropriate nix-shell with the binaries installed by first testing this with: + +``` +nix-shell -A shell +``` + +## Installation + +You might choose to simply copy the derivations from this repository, or you can fetch the git/Github repo using the various helpers. + +## NixOS: Contributors needed + +If you want to use this in NixOS, then please supply some PRs for the appropriate patchelf voodoo. diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..e0c5c79 --- /dev/null +++ b/default.nix @@ -0,0 +1,21 @@ +{ pkgs ? import {} }: + +let + dhall-simple = import ./dhall-simple.nix {}; + dhall-json-simple = import ./dhall-json-simple.nix {}; + dhall-bash-simple = import ./dhall-bash-simple.nix {}; + dhall-text-simple = import ./dhall-text-simple.nix {}; +in { + inherit dhall-simple; + + shell = pkgs.stdenv.mkDerivation { + name = "easy-dhall-nix-shell"; + + buildInputs = [ + dhall-simple + dhall-json-simple + dhall-bash-simple + dhall-text-simple + ]; + }; +} diff --git a/dhall-bash-simple.nix b/dhall-bash-simple.nix new file mode 100644 index 0000000..d0de3c5 --- /dev/null +++ b/dhall-bash-simple.nix @@ -0,0 +1,17 @@ +{ pkgs ? import {} }: + +pkgs.stdenv.mkDerivation rec { + name = "dhall-bash-simple"; + version = "1.0.17"; + dhall-version = "1.19.1"; + + src = pkgs.fetchurl { + url = "https://github.com/dhall-lang/dhall-haskell/releases/download/${dhall-version}/dhall-bash-${version}-x86_64-linux.tar.bz2"; + sha256 = "1y3rglsdmcbiarwfp907hxdd8swvdsh2874m9m4622ws4avz4v95"; + }; + + installPhase = '' + mkdir -p $out/bin + install -D -m555 -T dhall-to-bash $out/bin/dhall-to-bash + ''; +} diff --git a/dhall-json-simple.nix b/dhall-json-simple.nix new file mode 100644 index 0000000..dddebd7 --- /dev/null +++ b/dhall-json-simple.nix @@ -0,0 +1,18 @@ +{ pkgs ? import {} }: + +pkgs.stdenv.mkDerivation rec { + name = "dhall-json-simple"; + version = "1.2.5"; + dhall-version = "1.19.1"; + + src = pkgs.fetchurl { + url = "https://github.com/dhall-lang/dhall-haskell/releases/download/${dhall-version}/dhall-json-${version}-x86_64-linux.tar.bz2"; + sha256 = "0h896bs7r8bxxagzfivxiyk2h4aym7lw7sk7yc4kxh0fr5dzk03g"; + }; + + installPhase = '' + mkdir -p $out/bin + install -D -m555 -T dhall-to-json $out/bin/dhall-to-json + install -D -m555 -T dhall-to-yaml $out/bin/dhall-to-yaml + ''; +} diff --git a/dhall-simple.nix b/dhall-simple.nix new file mode 100644 index 0000000..bab5657 --- /dev/null +++ b/dhall-simple.nix @@ -0,0 +1,16 @@ +{ pkgs ? import {} }: + +pkgs.stdenv.mkDerivation rec { + name = "dhall-simple"; + version = "1.19.1"; + + src = pkgs.fetchurl { + url = "https://github.com/dhall-lang/dhall-haskell/releases/download/${version}/dhall-${version}-x86_64-linux.tar.bz2"; + sha256 = "088qi8dsxwzyry8ws797kljpyyn18v6hfckvlw18q5bxkvxk0c83"; + }; + + installPhase = '' + mkdir -p $out/bin + install -D -m555 -T dhall $out/bin/dhall + ''; +} diff --git a/dhall-text-simple.nix b/dhall-text-simple.nix new file mode 100644 index 0000000..e02c3fe --- /dev/null +++ b/dhall-text-simple.nix @@ -0,0 +1,17 @@ +{ pkgs ? import {} }: + +pkgs.stdenv.mkDerivation rec { + name = "dhall-json-simple"; + version = "1.0.14"; + dhall-version = "1.19.1"; + + src = pkgs.fetchurl { + url = "https://github.com/dhall-lang/dhall-haskell/releases/download/${dhall-version}/dhall-text-${version}-x86_64-linux.tar.bz2"; + sha256 = "1z3rxl9fmm9lqg8mlis36aybmvg3dhdz9pbgs1vs4dxk33ig6qmj"; + }; + + installPhase = '' + mkdir -p $out/bin + install -D -m555 -T dhall-to-text $out/bin/dhall-to-text + ''; +} diff --git a/test.bash b/test.bash new file mode 100755 index 0000000..53f919f --- /dev/null +++ b/test.bash @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +ERRORS=0; + +function test_exe () { + EXE=$1; + LOCATION=$(command -v "$EXE"); + if [ -x "$LOCATION" ]; then + echo "found $EXE"; + else + echo "didnt find $EXE"; + ERRORS=1; + fi +} + +test_exe dhall; +test_exe dhall-to-json; +test_exe dhall-to-yaml; +test_exe dhall-to-bash; +test_exe dhall-to-text; + +exit $ERRORS;