Log the default 'packages' value

This commit is contained in:
Sridhar Ratnakumar 2023-04-27 11:52:52 -04:00
parent eed521db07
commit 1ca25ec71f
2 changed files with 11 additions and 6 deletions

View File

@ -7,7 +7,7 @@
- #143: Changed `autoWire` to be an enum type, for granular controlling of which outputs to autowire. - #143: Changed `autoWire` to be an enum type, for granular controlling of which outputs to autowire.
- #137: Expose cabal executables as flake apps. Add a corresponding `outputs.apps` option, while the `outputs.localPackages` option is renamed to `outputs.packages` (it now contains package metadata, including packages and its executables). - #137: Expose cabal executables as flake apps. Add a corresponding `outputs.apps` option, while the `outputs.localPackages` option is renamed to `outputs.packages` (it now contains package metadata, including packages and its executables).
- #148: Remove automatic hpack->cabal generation. Use `pre-commit-hooks.nix` instead. - #148: Remove automatic hpack->cabal generation. Use `pre-commit-hooks.nix` instead.
- #149: Fix unnecessary re-runs of cabal2nix evaluation. Add a `debug` option to enable produce verbose diagnostic messages. - #149: Fix unnecessary re-runs of cabal2nix evaluation. Add a `debug` option to have haskell-flake produce diagnostic messages.
## 0.2.0 (Mar 13, 2023) ## 0.2.0 (Mar 13, 2023)

View File

@ -18,7 +18,6 @@ in
let let
appType = import ./types/app-type.nix { inherit pkgs lib; }; appType = import ./types/app-type.nix { inherit pkgs lib; };
haskellOverlayType = import ./types/haskell-overlay-type.nix { inherit lib; }; haskellOverlayType = import ./types/haskell-overlay-type.nix { inherit lib; };
log = import ./logging.nix { };
hlsCheckSubmodule = types.submodule { hlsCheckSubmodule = types.submodule {
options = { options = {
@ -189,7 +188,10 @@ in
specialArgs = { inherit pkgs self; }; specialArgs = { inherit pkgs self; };
modules = [ modules = [
./haskell-project.nix ./haskell-project.nix
({ config, ... }: ({ config, name, ... }:
let
log = import ./logging.nix { inherit (config) debug; };
in
{ {
options = { options = {
projectRoot = mkOption { projectRoot = mkOption {
@ -286,9 +288,12 @@ in
''; '';
}; };
in in
lib.mapAttrs lib.pipe config.projectRoot [
(_: path: { root = path; }) haskell-parsers.findPackagesInCabalProject
(haskell-parsers.findPackagesInCabalProject config.projectRoot); (x: log.traceDebug "config.haskellProjects.${name}.packages = ${builtins.toJSON x}" x)
(lib.mapAttrs (_: path: { root = path; }))
];
defaultText = lib.literalMD "autodiscovered by reading `self` files."; defaultText = lib.literalMD "autodiscovered by reading `self` files.";
}; };
devShell = mkOption { devShell = mkOption {