Files
haskell.nix/modules/flake.nix
Hamish Mackenzie a070082964 Improve flake code (#1743)
* Add hydraJobs.devShell and flatten hydraJobs

Also moves the `rawFlake` code into a `haskellLib.mkFlake` function

* Unflatten hydraJobs and add ciJobs

It turns out it is nice to use system first in the hierarchy for cicero.  Also both hydra and cicero are ok with a deep hierarchy of attributes.

* Refactoring

* Add mkFlakeCiJobs

* Avoid `:` in ciJobs and hydraJobs

* Use cabal names again in ciJobs

* More updates

Turns off code coverage by default.
Rename flattenChecks to mkFlakeChecks.
Adds flake packages to ciJobs and hydraJobs.

* Expand comment
2022-10-11 23:52:50 +13:00

48 lines
1.4 KiB
Nix

{ projectConfig }:
{ lib, config, pkgs, haskellLib, ... }: {
options = {
packages = lib.mkOption {
type = lib.types.unspecified;
default = haskellLib.selectProjectPackages;
};
crossPlatforms = lib.mkOption {
type = lib.types.unspecified;
default = projectConfig.crossPlatforms;
};
variants = lib.mkOption {
type = lib.types.attrsOf lib.types.unspecified;
default = {};
description = ''
This allows flakes to easily include variations of the
project by with different project arguments.
Anything you can pass to `project.addModule` can be used.
For instance to include variants using ghc 9.2.4:
```
flake.variants.ghc924.compiler-nix-name = pkgs.lib.mkForce "ghc924";
```
Then use it with:
```
nix build .#ghc924:hello:exe:hello
```
'';
};
doCoverage = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Specifies if the flake `ciJobs` and `hydraJobs` should include code
coverage reports.
'';
};
coverageProjectModule = lib.mkOption {
type = lib.types.unspecified;
default = {};
description = ''
Project module for use when generating coverage reports.
The project packages will have `packages.X.doCoverage`
turned on by default.
'';
};
};
}