Add Dhall env

This commit is contained in:
Luc Perkins 2022-07-29 00:29:33 +02:00
parent a6b3c2ac6b
commit b502b21c7e
No known key found for this signature in database
GPG key ID: 4F102D0C16E232F2
14 changed files with 115 additions and 28 deletions

1
dhall/.envrc Normal file
View file

@ -0,0 +1 @@
use flake .

42
dhall/flake.lock generated Normal file
View file

@ -0,0 +1,42 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1656928814,
"narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1659047146,
"narHash": "sha256-2qZemVRDR5oCw0Hd32LQSWC7FaEy5sUp5ih9OxqE3yU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "68716026a095a765c09ec29f06ba234a0298418c",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

40
dhall/flake.nix Normal file
View file

@ -0,0 +1,40 @@
{
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
dhall-lsp-server
dhall-nix
dhall-json
dhall-toml
dhall-yaml
] ++ optionals isLinux (with pkgs.haskellPackages; [ dhall-csv dhall-haskell ]);
inherit (pkgs) mkShell;
in {
devShells = {
default = pkgs.mkShell {
buildInputs = [ dhall ] ++ otherFormats;
shellHook = ''
echo "dhall `${dhall}/bin/dhall --version`"
'';
};
};
});
}