mirror of
https://github.com/srid/ema.git
synced 2024-11-28 23:42:59 +03:00
66 lines
2.4 KiB
Nix
66 lines
2.4 KiB
Nix
{
|
|
description = "Ema project";
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
flake-parts.inputs.nixpkgs.follows = "nixpkgs";
|
|
haskell-flake.url = "github:srid/haskell-flake";
|
|
};
|
|
outputs = inputs@{ self, nixpkgs, flake-parts, haskell-flake, ... }:
|
|
flake-parts.lib.mkFlake { inherit self; } {
|
|
systems = nixpkgs.lib.systems.flakeExposed;
|
|
imports = [
|
|
haskell-flake.flakeModule
|
|
];
|
|
perSystem = { config, pkgs, ... }: {
|
|
# This attr is provided by https://github.com/srid/haskell-flake
|
|
haskellProjects = {
|
|
ghc90 = {
|
|
root = ./.;
|
|
buildTools = hp: {
|
|
inherit (pkgs)
|
|
treefmt
|
|
nixpkgs-fmt;
|
|
inherit (hp)
|
|
cabal-fmt
|
|
fourmolu;
|
|
};
|
|
modifier = drv: with pkgs.haskell.lib; dontCheck drv; # test/type-errors requires 9.2
|
|
};
|
|
ghc92 = {
|
|
root = ./.;
|
|
haskellPackages = pkgs.haskell.packages.ghc924; # Needed for `UnconsSymbol`
|
|
buildTools = hp:
|
|
let
|
|
# https://github.com/NixOS/nixpkgs/issues/140774 reoccurs in GHC 9.2
|
|
workaround140774 = hpkg: with pkgs.haskell.lib;
|
|
overrideCabal hpkg (drv: {
|
|
enableSeparateBinOutput = false;
|
|
});
|
|
in
|
|
{
|
|
inherit (pkgs)
|
|
treefmt
|
|
nixpkgs-fmt;
|
|
inherit (pkgs.haskellPackages)
|
|
cabal-fmt;
|
|
inherit (hp)
|
|
fourmolu;
|
|
ghcid = workaround140774 hp.ghcid;
|
|
};
|
|
source-overrides = { };
|
|
overrides = self: super: with pkgs.haskell.lib; {
|
|
# All these below are for GHC 9.2 compat.
|
|
relude = dontCheck super.relude_1_1_0_0; # Not the default in nixpkgs yet.
|
|
retry = dontCheck super.retry;
|
|
http2 = dontCheck super.http2; # Fails on darwin
|
|
type-errors-pretty = dontCheck (doJailbreak super.type-errors-pretty);
|
|
streaming-commons = dontCheck super.streaming-commons; # Fails on darwin
|
|
};
|
|
};
|
|
};
|
|
devShells.default = config.devShells.ghc92;
|
|
};
|
|
};
|
|
}
|