2021-04-19 18:07:52 +03:00
|
|
|
{
|
|
|
|
description = "Ema project";
|
|
|
|
inputs = {
|
2021-04-20 22:04:48 +03:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/8389dcb67d934ee72c1d1e7228d92be9b3f71bad";
|
2021-04-19 18:07:52 +03:00
|
|
|
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 = [ ];
|
2021-04-20 22:04:48 +03:00
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system overlays;
|
|
|
|
config.allowBroken = true; # To allow `org-mode` package which is broken
|
|
|
|
};
|
2021-04-19 18:07:52 +03:00
|
|
|
emaProject = returnShellEnv:
|
|
|
|
pkgs.haskellPackages.developPackage {
|
|
|
|
inherit returnShellEnv;
|
|
|
|
name = "ema";
|
|
|
|
root = ./.;
|
|
|
|
withHoogle = false;
|
2021-04-20 22:04:48 +03:00
|
|
|
overrides = self: super: with pkgs.haskell.lib; {
|
|
|
|
org-mode = dontCheck super.org-mode; # `tasty` dependency is broken on nixpkgs
|
|
|
|
};
|
2021-04-19 18:07:52 +03:00
|
|
|
modifier = drv:
|
|
|
|
pkgs.haskell.lib.addBuildTools drv (with pkgs.haskellPackages;
|
|
|
|
[
|
|
|
|
cabal-install
|
|
|
|
cabal-fmt
|
|
|
|
pkgs.nixpkgs-fmt
|
|
|
|
ghcid
|
|
|
|
ormolu
|
|
|
|
haskell-language-server
|
|
|
|
]);
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
2021-04-19 18:36:51 +03:00
|
|
|
# Used by `nix build`
|
2021-04-19 18:07:52 +03:00
|
|
|
defaultPackage = emaProject false;
|
|
|
|
|
2021-04-19 18:36:51 +03:00
|
|
|
# Used by `nix develop`
|
2021-04-19 18:07:52 +03:00
|
|
|
devShell = emaProject true;
|
|
|
|
});
|
|
|
|
}
|