on iko/ghcjs-patch-master help sign in
Reduce `roots` to a single derivation. (#774)

This makes it less noisy when added to haskell.nix. This change also simplifies things to just use `ifdLevel` 2. In the past higher `ifdLevels` were not always supersets of the lower levels. This is no longer the case so we can safely use just level 2.

commit32baaac4d7858ae3349c1f6d1452371f998c7f49 authorHamish Mackenzie <Hamish.Mackenzie@iohk.io> dateMon 20 Jul 2020, 20:35 (6 years ago) parent68a5b50
2 files changed+9−8
changelog.md+3 overlays/haskell.nix+6−8
changelog.md+3
@@ -1,6 +1,9 @@
11This file contains a summary of changes to Haskell.nix and `nix-tools`
22that will impact users.
33
4+## July ?, 2020
5+* Changed `haskell-nix.roots` and `p.roots` to single derivations.
6+
47## July 8, 2020
58* Removed `sources.nixpkgs-default`, use `sources.nixpkgs` instead.
69* Removed `./nixpkgs` directory, use `(import ./. {}).sources`
overlays/haskell.nix+6−8
@@ -620,14 +620,12 @@ final: prev: {
620620 withInputs = final.recurseIntoAttrs;
621621
622622 # Add this to your tests to make all the dependencies of haskell.nix
623− # are tested and cached.
624− roots = compiler-nix-name: final.recurseIntoAttrs {
625− Level0 = roots' compiler-nix-name 0;
626− Level1 = roots' compiler-nix-name 1;
627− # Should be safe to use this now we have materialized everything
628− # except the tests
629− Level2 = roots' compiler-nix-name 2;
630− };
623+ # are tested and cached. Consider using `p.roots` where `p` is a
624+ # project as it will automatically match the `compiler-nix-name`
625+ # of the project.
626+ roots = compiler-nix-name: final.linkFarm "haskell-nix-roots-${compiler-nix-name}"
627+ (final.lib.mapAttrsToList (name: path: { inherit name path; })
628+ (roots' compiler-nix-name 2));
631629
632630 roots' = compiler-nix-name: ifdLevel:
633631 final.recurseIntoAttrs ({