Skip to content

Commit

Permalink
Remove deprecated hsPkgs.x functions
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishmack committed Nov 24, 2020
1 parent fa98e5e commit 64dff9e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
9 changes: 8 additions & 1 deletion changelog.md
@@ -1,11 +1,18 @@
This file contains a summary of changes to Haskell.nix and `nix-tools`
that will impact users.

## Nov 25, 2020
* The `shellFor` `makeConfigFiles` `ghcWithHoogle` and `ghcWithPackages`
functions have been removed from `project.hsPkgs`. Instead access
them from `project` itself (e.g. change `p.hsPkgs.shellFor` to `p.shellFor`).
* The reflex-platform like `project.shells.ghc` has been removed.
If needed, add something like `p // { shells.ghc = p.shellFor {} }`
to `shell.nix`.

## Nov 24, 2020
* Added `${targetPrefix}cabal` wrapper script for running cross
compilers in `shellFor`.
* `otherShells` arg added to `shellFor`.
* project.hsPkgs.${n} has been deprecated in favour of project.${n}.

## Oct 31, 2020
* Passing `tools.hoogle` to `shellFor` with a value suitable for `haskel-nix.tool` will
Expand Down
18 changes: 4 additions & 14 deletions overlays/haskell.nix
Expand Up @@ -531,7 +531,7 @@ final: prev: {
final.lib.fix (project':
let project = project' // { recurseForDerivations = false; };
in rawProject // rec {
hsPkgs = (final.lib.mapAttrs (n: package':
hsPkgs = final.lib.mapAttrs (n: package':
if package' == null
then null
else
Expand All @@ -554,23 +554,13 @@ final: prev: {
ghc = project.pkg-set.config.ghc.package;
});
}
) rawProject.hsPkgs
// (final.lib.mapAttrs (n:
__trace "project.hsPkgs.${n} has been deprecated in favour of project.${n}"
) {
# These are functions not packages
inherit (rawProject.hsPkgs) shellFor makeConfigFiles ghcWithHoogle ghcWithPackages;
}
)
);
) (builtins.removeAttrs rawProject.hsPkgs
# These are functions not packages
[ "shellFor" "makeConfigFiles" "ghcWithHoogle" "ghcWithPackages" ]);

projectCoverageReport = haskellLib.projectCoverageReport (map (pkg: pkg.coverageReport) (final.lib.attrValues (haskellLib.selectProjectPackages hsPkgs)));

inherit (rawProject.hsPkgs) makeConfigFiles ghcWithHoogle ghcWithPackages shellFor;

# Provide `nix-shell -A shells.ghc` for users migrating from the reflex-platform.
# But we should encourage use of `nix-shell -A shellFor`
shells.ghc = project.shellFor {};
});

cabalProject =
Expand Down

0 comments on commit 64dff9e

Please sign in to comment.