This commit is contained in:
justinwoo 2018-12-08 13:34:40 +02:00
commit 87406a7640
8 changed files with 136 additions and 0 deletions

4
Makefile Normal file
View File

@ -0,0 +1,4 @@
default: test
test:
nix-shell -A shell --pure --run './test.bash'

21
README.md Normal file
View File

@ -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.

21
default.nix Normal file
View File

@ -0,0 +1,21 @@
{ pkgs ? import <nixpkgs> {} }:
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
];
};
}

17
dhall-bash-simple.nix Normal file
View File

@ -0,0 +1,17 @@
{ pkgs ? import <nixpkgs> {} }:
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
'';
}

18
dhall-json-simple.nix Normal file
View File

@ -0,0 +1,18 @@
{ pkgs ? import <nixpkgs> {} }:
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
'';
}

16
dhall-simple.nix Normal file
View File

@ -0,0 +1,16 @@
{ pkgs ? import <nixpkgs> {} }:
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
'';
}

17
dhall-text-simple.nix Normal file
View File

@ -0,0 +1,17 @@
{ pkgs ? import <nixpkgs> {} }:
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
'';
}

22
test.bash Executable file
View File

@ -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;