Files
Hamish Mackenzie 4c8bbbd3ed Add flake.variants (#1661)
* Add flake.variants

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
```

This change also:

* Exposes add `combineFlakes` and `rawFlake` for more control over how flakes are combined.

* Includes package coverageReports to the `hydraJobs` of the flakes.

* Tries to make the materialisation concurrency test more reliable
2022-09-16 22:21:54 +12:00

29 lines
801 B
Nix

{ n }:
# This test makes sure that adding materialize function call with no materialized files
# does not impact performance by reducing the ability of nix to perform concurrent
# builds.
let
inherit (import ../../. {}) pkgs;
hello = pkgs.haskell-nix.materialize { materialized = null; } (pkgs.runCommand "hello" {} ''
echo ${n}
echo EVENT start hello
sleep 5
echo EVENT end hello
echo hello > $out
'');
world = pkgs.haskell-nix.materialize { materialized = null; } (pkgs.runCommand "world" {} ''
echo ${n}
echo EVENT start world
sleep 15
echo EVENT end world
echo world > $out
'');
hello-world = pkgs.runCommand "hello-world" {} ''
cat ${hello} > $out
echo ' '
cat ${world} > $out
'';
in hello-world