2021-04-19 18:07:52 +03:00
|
|
|
{
|
|
|
|
description = "Ema project";
|
|
|
|
inputs = {
|
2022-07-17 22:11:52 +03:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
2022-05-30 16:32:57 +03:00
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
|
|
flake-parts.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
haskell-flake.url = "github:srid/haskell-flake";
|
2022-07-17 22:11:52 +03:00
|
|
|
# 1.1 not in nixpkgs or cabal hashes yet
|
2022-06-26 23:03:22 +03:00
|
|
|
relude.url = "github:kowainik/relude/v1.1.0.0";
|
|
|
|
relude.flake = false;
|
2021-04-19 18:07:52 +03:00
|
|
|
};
|
2022-06-26 23:03:22 +03:00
|
|
|
outputs = inputs@{ self, nixpkgs, flake-parts, haskell-flake, ... }:
|
2022-05-30 16:32:57 +03:00
|
|
|
flake-parts.lib.mkFlake { inherit self; } {
|
|
|
|
systems = nixpkgs.lib.systems.flakeExposed;
|
|
|
|
imports = [
|
|
|
|
haskell-flake.flakeModule
|
|
|
|
];
|
2022-06-28 18:01:18 +03:00
|
|
|
perSystem = { config, pkgs, ... }: {
|
2022-06-11 18:42:44 +03:00
|
|
|
# This attr is provided by https://github.com/srid/haskell-flake
|
2022-06-28 18:01:18 +03:00
|
|
|
haskellProjects = {
|
|
|
|
ghc90 = {
|
|
|
|
root = ./.;
|
|
|
|
buildTools = hp: {
|
2022-06-26 23:03:22 +03:00
|
|
|
inherit (pkgs)
|
|
|
|
treefmt
|
|
|
|
nixpkgs-fmt;
|
2022-06-28 18:01:18 +03:00
|
|
|
inherit (hp)
|
|
|
|
cabal-fmt
|
2022-08-06 21:00:16 +03:00
|
|
|
fourmolu;
|
2022-06-26 23:03:22 +03:00
|
|
|
};
|
2022-08-06 21:00:16 +03:00
|
|
|
modifier = drv: with pkgs.haskell.lib; dontCheck drv; # test/type-errors requires 9.2
|
2022-06-26 23:03:22 +03:00
|
|
|
};
|
2022-06-28 18:01:18 +03:00
|
|
|
ghc92 = {
|
|
|
|
root = ./.;
|
2022-08-06 19:53:56 +03:00
|
|
|
haskellPackages = pkgs.haskell.packages.ghc924; # Needed for `UnconsSymbol`
|
2022-06-28 18:01:18 +03:00
|
|
|
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;
|
2022-08-06 21:06:04 +03:00
|
|
|
inherit (hp)
|
|
|
|
fourmolu;
|
2022-06-28 18:01:18 +03:00
|
|
|
ghcid = workaround140774 hp.ghcid;
|
|
|
|
};
|
|
|
|
source-overrides = {
|
|
|
|
inherit (inputs) relude;
|
|
|
|
};
|
|
|
|
overrides = self: super: with pkgs.haskell.lib; {
|
2022-07-02 16:58:11 +03:00
|
|
|
# All these below are for GHC 9.2 compat.
|
|
|
|
relude = dontCheck super.relude;
|
|
|
|
retry = dontCheck super.retry;
|
|
|
|
http2 = dontCheck super.http2; # Fails on darwin
|
2022-07-20 18:32:42 +03:00
|
|
|
type-errors-pretty = dontCheck (doJailbreak super.type-errors-pretty);
|
2022-07-02 16:58:11 +03:00
|
|
|
streaming-commons = dontCheck super.streaming-commons; # Fails on darwin
|
2022-06-28 18:01:18 +03:00
|
|
|
};
|
2021-04-19 18:07:52 +03:00
|
|
|
};
|
2022-05-30 16:32:57 +03:00
|
|
|
};
|
2022-06-28 18:01:18 +03:00
|
|
|
devShells.default = config.devShells.ghc92;
|
2022-05-30 16:32:57 +03:00
|
|
|
};
|
2022-03-27 21:21:48 +03:00
|
|
|
};
|
2021-04-19 18:07:52 +03:00
|
|
|
}
|