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