├── .github └── workflows │ └── ci.yml ├── LICENSE ├── README.md ├── build.nix ├── default.nix ├── dhall-bash-simple.nix ├── dhall-csv-simple.nix ├── dhall-docs-simple.nix ├── dhall-json-simple.nix ├── dhall-lsp-simple.nix ├── dhall-nix-simple.nix ├── dhall-simple.nix ├── dhall-toml-simple.nix ├── dhall-yaml-simple.nix ├── fetch.py ├── nixpkgs.json ├── nixpkgs.nix ├── release.json ├── release.nix ├── shell.nix ├── test.nix └── test.sh /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | types: 9 | - opened 10 | - synchronize 11 | 12 | jobs: 13 | my_job: 14 | runs-on: ${{ matrix.os }} 15 | 16 | strategy: 17 | matrix: 18 | os: [ubuntu-latest, macos-latest] 19 | 20 | steps: 21 | - uses: actions/checkout@v3 22 | - uses: cachix/install-nix-action@v20 23 | - run: ./test.sh 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 Justin Woo 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Easy Dhall Nix 2 | 3 | Derivations for easily downloading Dhall binaries and putting them to use. 4 | 5 | ## Trial 6 | 7 | You can get an appropriate nix-shell with the binaries installed by first testing this with: 8 | 9 | ``` 10 | nix-shell 11 | ``` 12 | 13 | ## Installation 14 | 15 | You might choose to simply copy the derivations from this repository, or you can fetch the git/Github repo using the various helpers: 16 | 17 | ``` 18 | > nix repl 19 | nix-repl> pkgs = import ./nixpkgs.nix {} 20 | 21 | nix-repl> drvs = import (pkgs.fetchFromGitHub { 22 | owner = "justinwoo"; 23 | repo = "easy-dhall-nix"; 24 | rev = # some REV 25 | sha256 = # some SHA 26 | }) { inherit pkgs; } 27 | 28 | nix-repl> drvs.dhall-simple 29 | «derivation /nix/store/qz29jbplpmlvsbmq05084dh1fbs8sl0h-dhall-simple.drv» 30 | ``` 31 | 32 | ## NixOS: Contributors needed 33 | 34 | The derivations here have been tested by others to work on NixOS. If you have problems, open an issue. 35 | 36 | ## Update this repository 37 | 38 | To update, run 39 | 40 | ``` 41 | ./fetch.py 42 | ``` 43 | 44 | from the root of this repository. 45 | It will prefetch the binaries from the latest dhall release on Github. 46 | -------------------------------------------------------------------------------- /build.nix: -------------------------------------------------------------------------------- 1 | { pkgs, release }: 2 | 3 | { simpleName, binNames, attrName, manPages ? [] }: 4 | 5 | let 6 | release = import ./release.nix; 7 | in 8 | 9 | pkgs.stdenv.mkDerivation rec { 10 | name = simpleName; 11 | 12 | src = if pkgs.stdenv.isDarwin 13 | then pkgs.fetchurl { 14 | url = release.${"${attrName}-darwin"}.url; 15 | sha256 = release.${"${attrName}-darwin"}.hash; 16 | } 17 | else pkgs.fetchurl { 18 | url = release.${"${attrName}-linux"}.url; 19 | sha256 = release.${"${attrName}-linux"}.hash; 20 | }; 21 | 22 | nativeBuildInputs = [ pkgs.installShellFiles ]; 23 | 24 | passthru.binNames = binNames; 25 | 26 | sourceRoot = "."; 27 | 28 | installPhase = '' 29 | mkdir -p $out/bin 30 | 31 | ${pkgs.lib.concatMapStringsSep "\n" (binName: '' 32 | binPath="$out/bin/${binName}" 33 | install -D -m555 -T "bin/${binName}" "$binPath" 34 | rm "bin/${binName}" 35 | 36 | "$binPath" --bash-completion-script "$binPath" > "${binName}.bash" 37 | installShellCompletion --bash "${binName}.bash" 38 | rm "${binName}.bash" 39 | "$binPath" --zsh-completion-script "$binPath" > "${binName}.zsh" 40 | installShellCompletion --zsh "${binName}.zsh" 41 | rm "${binName}.zsh" 42 | "$binPath" --fish-completion-script "$binPath" > "${binName}.fish" 43 | installShellCompletion --fish "${binName}.fish" 44 | rm "${binName}.fish" 45 | '') binNames} 46 | 47 | rmdir bin 48 | 49 | # https://github.com/dhall-lang/dhall-haskell/issues/2161 50 | rm share/man/dhall-docs.1 \ 51 | share/man/dhall-docs.md \ 52 | share/man/gen-manpage.sh \ 53 | && rmdir share/man && rmdir share \ 54 | || true 55 | rm share/man/dhall.1 \ 56 | share/man/dhall.md \ 57 | && rmdir share/man && rmdir share \ 58 | || true 59 | ${pkgs.lib.optionalString (manPages != []) '' 60 | ${pkgs.lib.concatMapStringsSep "\n" (manPage: '' 61 | # TODO: split into $man output 62 | manPagePath="$out/share/man/man1/${manPage}" 63 | install -D -m644 -T "share/man/man1/${manPage}" "$manPagePath" 64 | rm "share/man/man1/${manPage}" 65 | '') manPages} 66 | rmdir --parent share/man/man1 67 | ''} 68 | 69 | # a bit hacky, but sourceRoot unfortunately unpacks to the runtime build dir 70 | rm env-vars .sandbox.sb || true 71 | 72 | # check that we didn’t forget any files (maybe a new binary was added) 73 | if [ ! -z "$(${pkgs.lr}/bin/lr -1 -t 'depth == 1' .)" ]; then 74 | echo "still some files remaining!" >&2 75 | ${pkgs.lr}/bin/lr . 76 | exit 1 77 | fi 78 | 79 | ''; 80 | } 81 | -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import ./nixpkgs.nix { } }: 2 | 3 | { 4 | dhall-simple = import ./dhall-simple.nix { 5 | inherit pkgs; 6 | }; 7 | 8 | dhall-json-simple = import ./dhall-json-simple.nix { 9 | inherit pkgs; 10 | }; 11 | 12 | dhall-bash-simple = import ./dhall-bash-simple.nix { 13 | inherit pkgs; 14 | }; 15 | 16 | dhall-nix-simple = import ./dhall-nix-simple.nix { 17 | inherit pkgs; 18 | }; 19 | 20 | dhall-yaml-simple = import ./dhall-yaml-simple.nix { 21 | inherit pkgs; 22 | }; 23 | 24 | dhall-lsp-simple = import ./dhall-lsp-simple.nix { 25 | inherit pkgs; 26 | }; 27 | 28 | dhall-docs-simple = import ./dhall-docs-simple.nix { 29 | inherit pkgs; 30 | }; 31 | 32 | dhall-csv-simple = import ./dhall-csv-simple.nix { 33 | inherit pkgs; 34 | }; 35 | 36 | dhall-toml-simple = import ./dhall-toml-simple.nix { 37 | inherit pkgs; 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /dhall-bash-simple.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import ./nixpkgs.nix {} }: 2 | 3 | import ./build.nix { inherit pkgs; release = import ./release.nix; } { 4 | simpleName = "dhall-bash-simple"; 5 | binNames = [ "dhall-to-bash" ]; 6 | attrName = "dhall-bash"; 7 | } 8 | -------------------------------------------------------------------------------- /dhall-csv-simple.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import ./nixpkgs.nix {} }: 2 | 3 | import ./build.nix { inherit pkgs; release = import ./release.nix; } { 4 | simpleName = "dhall-csv-simple"; 5 | binNames = [ "dhall-to-csv" "csv-to-dhall" ]; 6 | attrName = "dhall-csv"; 7 | } 8 | -------------------------------------------------------------------------------- /dhall-docs-simple.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import ./nixpkgs.nix { } }: 2 | 3 | import ./build.nix { inherit pkgs; release = import ./release.nix; } { 4 | simpleName = "dhall-docs-simple"; 5 | binNames = [ "dhall-docs" ]; 6 | attrName = "dhall-docs"; 7 | # see https://github.com/dhall-lang/dhall-haskell/issues/2104 8 | manPages = if pkgs.stdenv.isDarwin then [ "dhall-docs.1" ] else []; 9 | } 10 | -------------------------------------------------------------------------------- /dhall-json-simple.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import ./nixpkgs.nix {} }: 2 | 3 | import ./build.nix { inherit pkgs; release = import ./release.nix; } { 4 | simpleName = "dhall-json-simple"; 5 | binNames = [ "dhall-to-json" "dhall-to-yaml" "json-to-dhall" ]; 6 | attrName = "dhall-json"; 7 | } 8 | -------------------------------------------------------------------------------- /dhall-lsp-simple.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import ./nixpkgs.nix {} }: 2 | 3 | import ./build.nix { inherit pkgs; release = import ./release.nix; } { 4 | simpleName = "dhall-lsp-simple"; 5 | binNames = [ "dhall-lsp-server" ]; 6 | attrName = "dhall-lsp-server"; 7 | } 8 | -------------------------------------------------------------------------------- /dhall-nix-simple.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import ./nixpkgs.nix {} }: 2 | 3 | import ./build.nix { inherit pkgs; release = import ./release.nix; } { 4 | simpleName = "dhall-nix-simple"; 5 | binNames = [ "dhall-to-nix" ]; 6 | attrName = "dhall-nix"; 7 | } 8 | -------------------------------------------------------------------------------- /dhall-simple.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import ./nixpkgs.nix {} }: 2 | 3 | import ./build.nix { inherit pkgs; release = import ./release.nix; } { 4 | simpleName = "dhall-simple"; 5 | binNames = [ "dhall" ]; 6 | attrName = "dhall"; 7 | # see https://github.com/dhall-lang/dhall-haskell/issues/2104 8 | manPages = if pkgs.stdenv.isDarwin then [ "dhall.1" ] else []; 9 | } 10 | -------------------------------------------------------------------------------- /dhall-toml-simple.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import ./nixpkgs.nix { } }: 2 | 3 | import ./build.nix { inherit pkgs; release = import ./release.nix; } { 4 | simpleName = "dhall-toml-simple"; 5 | binNames = [ "dhall-to-toml" "toml-to-dhall" ]; 6 | attrName = "dhall-toml"; 7 | } 8 | -------------------------------------------------------------------------------- /dhall-yaml-simple.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import ./nixpkgs.nix {} }: 2 | 3 | import ./build.nix { inherit pkgs; release = import ./release.nix; } { 4 | simpleName = "dhall-yaml-simple"; 5 | binNames = [ "dhall-to-yaml-ng" "yaml-to-dhall" ]; 6 | attrName = "dhall-yaml"; 7 | } 8 | -------------------------------------------------------------------------------- /fetch.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env nix-shell 2 | #!nix-shell -I nixpkgs=./nixpkgs.nix -i python3 -p python3 curl nix 3 | 4 | import json 5 | import re 6 | import subprocess as sub 7 | import sys 8 | 9 | # fetch the release info from releases/latest 10 | def curl_latest_release(): 11 | url = "https://api.github.com/repos/dhall-lang/dhall-haskell/releases/latest" 12 | return json.loads(sub.check_output(["curl", url])) 13 | 14 | # fetch the latest nixos unstable version 15 | def curl_latest_nixos_unstable(): 16 | url = "https://nixos.org/channels/nixos-unstable/git-revision" 17 | return sub.check_output(["curl", "--location", url]).strip().decode() 18 | 19 | def update_nixpkgs(lockfile_path, new_hash): 20 | # --unpack produces the hash required by `builtins.fetchTarball` 21 | github_archive = "https://github.com/NixOS/nixpkgs/archive/{}.tar.gz".format(new_hash) 22 | hash = sub.check_output([ 23 | "nix-prefetch-url", '--unpack', github_archive 24 | ]).strip().decode() 25 | date = sub.check_output([ 26 | "date", "--iso-8601=minutes" 27 | ]).strip().decode() 28 | with open(lockfile_path, 'w') as f: 29 | json.dump({ 30 | "comment": "autogenerated by fetch.py", 31 | "url": github_archive, 32 | "sha256": hash, 33 | "date": date 34 | }, f, indent=2) 35 | 36 | 37 | # call nix-prefetch-url on each asset to get their hashes 38 | def prefetch_binaries(release): 39 | res = [] 40 | for a in release['assets']: 41 | if "linux" in a['name'] or "macOS" in a['name']: 42 | print(a['name'], file=sys.stderr) 43 | hash = sub.check_output([ 44 | "nix-prefetch-url", a['browser_download_url'] 45 | ]).strip().decode() 46 | res += [{ 47 | 'name': a['name'], 48 | 'url': a['browser_download_url'], 49 | 'hash': hash 50 | }] 51 | return res 52 | 53 | # convert the list of binaries to an object we can address 54 | def postprocess(fetched): 55 | obj = {} 56 | for i in fetched: 57 | # split on the first digit ("dhall-foo-bar-1.2.3") 58 | name = re.split(r'-\d', i['name'])[0] 59 | post = "-linux" if "linux" in i['name'] else "-darwin" 60 | obj[name + post] = i 61 | return(obj) 62 | 63 | 64 | if __name__ == "__main__": 65 | print("updating nixpkgs to latest unstable", file=sys.stderr) 66 | nixos_hash = curl_latest_nixos_unstable() 67 | update_nixpkgs("./nixpkgs.json", nixos_hash) 68 | 69 | release = curl_latest_release() 70 | version = release['tag_name'] 71 | 72 | print("updating to release {}".format(version), file=sys.stderr) 73 | fetched = prefetch_binaries(release) 74 | res = postprocess(fetched) 75 | 76 | print("writing ./release.json", file=sys.stderr) 77 | with open("./release.json", mode='w') as f: 78 | json.dump(res, f, indent=2) 79 | -------------------------------------------------------------------------------- /nixpkgs.json: -------------------------------------------------------------------------------- 1 | { 2 | "comment": "autogenerated by fetch.py", 3 | "url": "https://github.com/NixOS/nixpkgs/archive/f00994e78cd39e6fc966f0c4103f908e63284780.tar.gz", 4 | "sha256": "0kpnpja0pv4bk12iqia6avll31i85327p5drs2ycni14qa166y54", 5 | "date": "2023-04-19T19:51+02:00" 6 | } -------------------------------------------------------------------------------- /nixpkgs.nix: -------------------------------------------------------------------------------- 1 | import (fetchTarball { 2 | inherit (builtins.fromJSON (builtins.readFile ./nixpkgs.json)) 3 | url 4 | sha256 5 | ; 6 | }) 7 | -------------------------------------------------------------------------------- /release.json: -------------------------------------------------------------------------------- 1 | { 2 | "dhall-linux": { 3 | "name": "dhall-1.42.0-x86_64-linux.tar.bz2", 4 | "url": "https://github.com/dhall-lang/dhall-haskell/releases/download/1.42.0/dhall-1.42.0-x86_64-linux.tar.bz2", 5 | "hash": "1phxqlda4b296j9msr7gg1079whkchf5bgxydl8w45r4qm1i8wi3" 6 | }, 7 | "dhall-darwin": { 8 | "name": "dhall-1.42.0-x86_64-macOS.tar.bz2", 9 | "url": "https://github.com/dhall-lang/dhall-haskell/releases/download/1.42.0/dhall-1.42.0-x86_64-macOS.tar.bz2", 10 | "hash": "0v6a52v7a69wkmc4wy5lyidvwgrd976w26vijj53mzpxb4n5bhad" 11 | }, 12 | "dhall-bash-linux": { 13 | "name": "dhall-bash-1.0.41-x86_64-linux.tar.bz2", 14 | "url": "https://github.com/dhall-lang/dhall-haskell/releases/download/1.42.0/dhall-bash-1.0.41-x86_64-linux.tar.bz2", 15 | "hash": "1cqc695d2yaw96b8g81yyyg7ccc99jd1l2xvmhw9j1gwv038m6rq" 16 | }, 17 | "dhall-bash-darwin": { 18 | "name": "dhall-bash-1.0.41-x86_64-macOS.tar.bz2", 19 | "url": "https://github.com/dhall-lang/dhall-haskell/releases/download/1.42.0/dhall-bash-1.0.41-x86_64-macOS.tar.bz2", 20 | "hash": "0ql2mvry46qckxk8swi9fm3smmcvxmkfamx74vxj8cchpxpgh0vj" 21 | }, 22 | "dhall-csv-linux": { 23 | "name": "dhall-csv-1.0.4-x86_64-linux.tar.bz2", 24 | "url": "https://github.com/dhall-lang/dhall-haskell/releases/download/1.42.0/dhall-csv-1.0.4-x86_64-linux.tar.bz2", 25 | "hash": "1hpk3b1v5iikassb9mdcy82pfvy5ajn9f3qg2skxmh2gj5ihq8r9" 26 | }, 27 | "dhall-csv-darwin": { 28 | "name": "dhall-csv-1.0.4-x86_64-macOS.tar.bz2", 29 | "url": "https://github.com/dhall-lang/dhall-haskell/releases/download/1.42.0/dhall-csv-1.0.4-x86_64-macOS.tar.bz2", 30 | "hash": "1964cikqnn92lxn2zkdy3qm69n4h60zj5gn79gyfwk1p6kh8g7v6" 31 | }, 32 | "dhall-docs-linux": { 33 | "name": "dhall-docs-1.0.11-x86_64-linux.tar.bz2", 34 | "url": "https://github.com/dhall-lang/dhall-haskell/releases/download/1.42.0/dhall-docs-1.0.11-x86_64-linux.tar.bz2", 35 | "hash": "17mp5c43g94ix4yfvbbyp2x4h96r9l34yiai36vhijkr7l7cfgnq" 36 | }, 37 | "dhall-docs-darwin": { 38 | "name": "dhall-docs-1.0.11-x86_64-macOS.tar.bz2", 39 | "url": "https://github.com/dhall-lang/dhall-haskell/releases/download/1.42.0/dhall-docs-1.0.11-x86_64-macOS.tar.bz2", 40 | "hash": "085riqdbjxffnk2h10yp3r1gjxi27s968m1ifc5ka4wg6ci2vznp" 41 | }, 42 | "dhall-json-linux": { 43 | "name": "dhall-json-1.7.12-x86_64-linux.tar.bz2", 44 | "url": "https://github.com/dhall-lang/dhall-haskell/releases/download/1.42.0/dhall-json-1.7.12-x86_64-linux.tar.bz2", 45 | "hash": "09x2m5a6ad980s93w1fqkr9mjbsaz95mlsq26zvgklj3c8lp2baw" 46 | }, 47 | "dhall-json-darwin": { 48 | "name": "dhall-json-1.7.12-x86_64-macOS.tar.bz2", 49 | "url": "https://github.com/dhall-lang/dhall-haskell/releases/download/1.42.0/dhall-json-1.7.12-x86_64-macOS.tar.bz2", 50 | "hash": "1l8j213v3x5lb4q9a9771lphryly23lsx7i4zxfp49amcf39i93f" 51 | }, 52 | "dhall-lsp-server-linux": { 53 | "name": "dhall-lsp-server-1.1.3-x86_64-linux.tar.bz2", 54 | "url": "https://github.com/dhall-lang/dhall-haskell/releases/download/1.42.0/dhall-lsp-server-1.1.3-x86_64-linux.tar.bz2", 55 | "hash": "061jqkawd4nzq6kg89nkzccrh9b5ii3nqlyh8l2kmk0g6bhqwmy1" 56 | }, 57 | "dhall-lsp-server-darwin": { 58 | "name": "dhall-lsp-server-1.1.3-x86_64-macOS.tar.bz2", 59 | "url": "https://github.com/dhall-lang/dhall-haskell/releases/download/1.42.0/dhall-lsp-server-1.1.3-x86_64-macOS.tar.bz2", 60 | "hash": "1m7mjvjnrbfm3glg6syi6fnyvs8y08w4xiabp220awzhbwx77qny" 61 | }, 62 | "dhall-nix-linux": { 63 | "name": "dhall-nix-1.1.26-x86_64-linux.tar.bz2", 64 | "url": "https://github.com/dhall-lang/dhall-haskell/releases/download/1.42.0/dhall-nix-1.1.26-x86_64-linux.tar.bz2", 65 | "hash": "0mj0qwmwnznx23lgwssz8qdmfdgm09lvd1l1khyyk1af0nz43d6x" 66 | }, 67 | "dhall-nix-darwin": { 68 | "name": "dhall-nix-1.1.26-x86_64-macOS.tar.bz2", 69 | "url": "https://github.com/dhall-lang/dhall-haskell/releases/download/1.42.0/dhall-nix-1.1.26-x86_64-macOS.tar.bz2", 70 | "hash": "02ijva5zj7png3x5pgx3mgjpldkl9svja5rqwg1lvzb99jhihiag" 71 | }, 72 | "dhall-nixpkgs-linux": { 73 | "name": "dhall-nixpkgs-1.0.10-x86_64-linux.tar.bz2", 74 | "url": "https://github.com/dhall-lang/dhall-haskell/releases/download/1.42.0/dhall-nixpkgs-1.0.10-x86_64-linux.tar.bz2", 75 | "hash": "0w992rhvq8y9gf5pph91k9rv0ad755kbk64f28gm0kjpadrv0wn1" 76 | }, 77 | "dhall-openapi-linux": { 78 | "name": "dhall-openapi-1.0.6-x86_64-linux.tar.bz2", 79 | "url": "https://github.com/dhall-lang/dhall-haskell/releases/download/1.42.0/dhall-openapi-1.0.6-x86_64-linux.tar.bz2", 80 | "hash": "102j4c2wi6qh1qixbm1dni464h7bw13sxlzgh3043g2jd4ld6y6b" 81 | }, 82 | "dhall-openapi-darwin": { 83 | "name": "dhall-openapi-1.0.6-x86_64-macOS.tar.bz2", 84 | "url": "https://github.com/dhall-lang/dhall-haskell/releases/download/1.42.0/dhall-openapi-1.0.6-x86_64-macOS.tar.bz2", 85 | "hash": "1b041chymwn9gn1nklajp3fqgjxb167x5f3lyw6d7ia5l35i6l60" 86 | }, 87 | "dhall-toml-linux": { 88 | "name": "dhall-toml-1.0.3-x86_64-linux.tar.bz2", 89 | "url": "https://github.com/dhall-lang/dhall-haskell/releases/download/1.42.0/dhall-toml-1.0.3-x86_64-linux.tar.bz2", 90 | "hash": "01hkl6xbih8k208cn72ybhsdqwny27q2rqf70hq192d3b198fl24" 91 | }, 92 | "dhall-toml-darwin": { 93 | "name": "dhall-toml-1.0.3-x86_64-macOS.tar.bz2", 94 | "url": "https://github.com/dhall-lang/dhall-haskell/releases/download/1.42.0/dhall-toml-1.0.3-x86_64-macOS.tar.bz2", 95 | "hash": "12nv168d0q4z2izxddhy8xj09f7lkl4k4v326cy70s79jb42x75x" 96 | }, 97 | "dhall-yaml-linux": { 98 | "name": "dhall-yaml-1.2.12-x86_64-linux.tar.bz2", 99 | "url": "https://github.com/dhall-lang/dhall-haskell/releases/download/1.42.0/dhall-yaml-1.2.12-x86_64-linux.tar.bz2", 100 | "hash": "1lsn3agbskav6703kmv1ssipzm0rg3biif351m5c24g4vgi07mlv" 101 | }, 102 | "dhall-yaml-darwin": { 103 | "name": "dhall-yaml-1.2.12-x86_64-macOS.tar.bz2", 104 | "url": "https://github.com/dhall-lang/dhall-haskell/releases/download/1.42.0/dhall-yaml-1.2.12-x86_64-macOS.tar.bz2", 105 | "hash": "1g5w0lam3h0gclrxy1hin4325299ipl01aaxsmz9nibs6a9faa8r" 106 | } 107 | } -------------------------------------------------------------------------------- /release.nix: -------------------------------------------------------------------------------- 1 | builtins.fromJSON (builtins.readFile ./release.json) 2 | -------------------------------------------------------------------------------- /shell.nix: -------------------------------------------------------------------------------- 1 | let 2 | pkgs = import ./nixpkgs.nix {}; 3 | 4 | default = import ./default.nix { 5 | inherit pkgs; 6 | }; 7 | 8 | in 9 | with default; pkgs.mkShell { 10 | buildInputs = [ 11 | dhall-simple 12 | dhall-json-simple 13 | dhall-bash-simple 14 | dhall-nix-simple 15 | dhall-yaml-simple 16 | dhall-lsp-simple 17 | dhall-docs-simple 18 | dhall-csv-simple 19 | dhall-toml-simple 20 | ]; 21 | } 22 | -------------------------------------------------------------------------------- /test.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import ./nixpkgs.nix {} }: 2 | 3 | let 4 | 5 | lib = pkgs.lib; 6 | 7 | executables = lib.concatLists 8 | (lib.mapAttrsToList 9 | # every package puts its binNames into passthru 10 | (_: v: map (bin: "${v}/bin/${bin}") v.passthru.binNames) 11 | (import ./default.nix { inherit pkgs; })); 12 | 13 | testExeLocation = pkgs.writers.writeDash "test-exe-location" '' 14 | set -e 15 | ERRORS=0; 16 | 17 | test_exe () { 18 | EXE=$1; 19 | echo "$EXE --version:" 20 | if $EXE --version; then 21 | return 0 22 | else 23 | echo "$EXE --version failed!" 24 | ERRORS=1 25 | fi 26 | } 27 | 28 | for exe in ${lib.escapeShellArgs executables}; do 29 | test_exe "$exe" 30 | done 31 | 32 | exit "$ERRORS" 33 | 34 | ''; 35 | 36 | in { 37 | inherit 38 | testExeLocation; 39 | } 40 | -------------------------------------------------------------------------------- /test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -e 3 | tmp="$(mktemp -d)" 4 | trap "rm -r $tmp" EXIT 5 | nix-build \ 6 | --out-link "$tmp"/result \ 7 | ./test.nix 8 | "$tmp/result" 9 | --------------------------------------------------------------------------------