dev-templates/dhall/flake.nix

43 lines
1.1 KiB
Nix
Raw Normal View History

2022-07-28 15:29:33 -07:00
{
description = "A Nix-flake-based Dhall development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
dhall = pkgs.dhall;
inherit (pkgs.lib) optionals;
inherit (pkgs.stdenv) isLinux;
otherFormats = with pkgs.haskellPackages; [
dhall-bash
dhall-docs
2022-07-28 15:32:39 -07:00
dhall-json
2022-07-28 15:29:33 -07:00
dhall-lsp-server
dhall-nix
2022-07-28 15:32:39 -07:00
dhall-nixpkgs
dhall-openapi
2022-07-28 15:29:33 -07:00
dhall-toml
dhall-yaml
2022-07-28 15:32:39 -07:00
] ++ optionals isLinux (with pkgs.haskellPackages; [ dhall-csv dhall-haskell dhall-text ]);
2022-07-28 15:29:33 -07:00
inherit (pkgs) mkShell;
in {
devShells = {
default = pkgs.mkShell {
buildInputs = [ dhall ] ++ otherFormats;
shellHook = ''
echo "dhall `${dhall}/bin/dhall --version`"
'';
};
};
});
}