2019-04-19 22:16:52 +02:00
|
|
|
{ args ? {} , shell ? "bash" }:
|
|
|
|
let
|
|
|
|
shared = import ./nix/shared.nix args;
|
|
|
|
static = shared.possibly-static;
|
|
|
|
in
|
|
|
|
shared.pkgs.runCommand "dhall-shell-${shell}" {
|
|
|
|
buildInputs = [
|
|
|
|
static.dhall
|
|
|
|
static.dhall-json
|
|
|
|
static.dhall-bash
|
|
|
|
static.dhall-nix
|
2019-11-07 13:11:04 +01:00
|
|
|
static.dhall-yaml
|
2019-04-19 22:16:52 +02:00
|
|
|
];
|
|
|
|
shellHook = ''
|
|
|
|
echo "Dhall core tools shell"
|
|
|
|
echo "USAGE EXAMPLES"
|
|
|
|
echo " Default (GHC version ${(import ./nix/shared.nix {}).pkgs.haskellPackages.ghc.version}, option completions shell - bash):"
|
|
|
|
echo " $ nix-shell"
|
|
|
|
echo " Overriding default GHC compiler (see ./nix/shared.nix for available options):"
|
|
|
|
echo " $ nix-shell --arg args '{ compiler = "ghc7103"; }'"
|
|
|
|
echo " Overriding option completion shell flavor:"
|
|
|
|
echo " $ nix-shell --argstr shell zsh"
|
|
|
|
|
2019-11-07 13:11:04 +01:00
|
|
|
source <(dhall --${shell}-completion-script dhall)
|
|
|
|
source <(dhall-to-bash --${shell}-completion-script dhall-to-bash)
|
|
|
|
source <(dhall-to-nix --${shell}-completion-script dhall-to-nix)
|
|
|
|
source <(dhall-to-json --${shell}-completion-script dhall-to-json)
|
|
|
|
source <(dhall-to-yaml --${shell}-completion-script dhall-to-yaml)
|
|
|
|
source <(dhall-to-yaml-ng --${shell}-completion-script dhall-to-yaml-ng)
|
|
|
|
source <(json-to-dhall --${shell}-completion-script json-to-dhall)
|
|
|
|
source <(yaml-to-dhall --${shell}-completion-script yaml-to-dhall)
|
2019-04-19 22:16:52 +02:00
|
|
|
'';
|
|
|
|
} ""
|