2021-05-31 23:19:51 +00:00
|
|
|
{
|
2021-06-01 02:46:25 +00:00
|
|
|
description = "haskell-template's description";
|
2021-05-31 23:19:51 +00:00
|
|
|
inputs = {
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
flake-compat = {
|
|
|
|
url = "github:edolstra/flake-compat";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
|
|
|
|
flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" ] (system:
|
|
|
|
let
|
|
|
|
overlays = [ ];
|
|
|
|
pkgs =
|
|
|
|
import nixpkgs { inherit system overlays; config.allowBroken = true; };
|
|
|
|
project = returnShellEnv:
|
|
|
|
pkgs.haskellPackages.developPackage {
|
|
|
|
inherit returnShellEnv;
|
|
|
|
name = "haskell-template";
|
|
|
|
root = ./.;
|
|
|
|
withHoogle = false;
|
|
|
|
overrides = self: super: with pkgs.haskell.lib; {
|
2021-06-01 02:46:25 +00:00
|
|
|
# Use callCabal2nix to override Haskell dependencies here
|
|
|
|
# cf. https://tek.brick.do/K3VXJd8mEKO7
|
2021-05-31 23:19:51 +00:00
|
|
|
};
|
|
|
|
modifier = drv:
|
|
|
|
pkgs.haskell.lib.addBuildTools drv (with pkgs.haskellPackages;
|
|
|
|
[
|
2021-06-01 02:46:25 +00:00
|
|
|
# Specify your build/dev dependencies here.
|
2021-05-31 23:19:51 +00:00
|
|
|
cabal-fmt
|
|
|
|
cabal-install
|
|
|
|
ghcid
|
|
|
|
haskell-language-server
|
|
|
|
ormolu
|
|
|
|
pkgs.nixpkgs-fmt
|
|
|
|
]);
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
2021-06-01 02:46:25 +00:00
|
|
|
# Used by `nix build` & `nix run` (prod exe)
|
2021-05-31 23:19:51 +00:00
|
|
|
defaultPackage = project false;
|
|
|
|
|
2021-06-01 02:46:25 +00:00
|
|
|
# Used by `nix develop` (dev shell)
|
2021-05-31 23:19:51 +00:00
|
|
|
devShell = project true;
|
|
|
|
});
|
|
|
|
}
|