Skip to content

Commit

Permalink
flake.nix: set -Werror GHC option for all project packages
Browse files Browse the repository at this point in the history
Stolen from `ouroboros-consensus`.
  • Loading branch information
coot committed Apr 15, 2024
1 parent bdc08cb commit 30b7588
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions flake.nix
Expand Up @@ -39,6 +39,15 @@

# alternative compilers
otherCompilers = ["ghc810"];

# from https://github.com/input-output-hk/haskell.nix/issues/298#issuecomment-767936405
forAllProjectPackages = cfg: args@{ lib, ... }: {
options.packages = lib.mkOption {
type = lib.types.attrsOf (lib.types.submodule ({ config, ... }: {
config = lib.mkIf config.package.isProject (cfg args);
}));
};
};
in
{inherit (inputs);}
// inputs.flake-utils.lib.eachSystem supportedSystems (
Expand Down Expand Up @@ -132,6 +141,9 @@
# package customizations as needed. Where cabal.project is not
# specific enough, or doesn't allow setting these.
modules = [
(forAllProjectPackages ({ ... }: {
ghcOptions = [ "-Werror" ];
}))
({pkgs, ...}: {
# We impose limit heap size limit when running some of the tests
# to discover space leaks Once #4698 and #4699 are done we can
Expand Down

0 comments on commit 30b7588

Please sign in to comment.