Skip to content

Commit bf4b6f2

Browse files
committed
Add support for package level overrides
1 parent 185b40e commit bf4b6f2

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

overlays/haskell.nix

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -753,11 +753,14 @@ final: prev: {
753753
({config, ...}: {
754754
packages = final.lib.listToAttrs (map (p: {
755755
name = to-key p;
756-
value.components = final.lib.optionalAttrs (config.packages ? ${p.pkg-name}) (
757-
builtins.mapAttrs (_: x: builtins.mapAttrs (_: x: final.lib.mkOverride 990 x)
758-
(builtins.removeAttrs x ["buildable" "planned" "depends" "build-tools"]))
759-
(final.lib.filterAttrs (_: x: x != null) config.packages.${p.pkg-name}.components)
760-
);
756+
value = {
757+
components = final.lib.optionalAttrs (config.packages ? ${p.pkg-name}) (
758+
builtins.mapAttrs (_: x: builtins.mapAttrs (_: x: final.lib.mkOverride 990 x)
759+
(builtins.removeAttrs x ["buildable" "planned" "depends" "build-tools"]))
760+
(final.lib.filterAttrs (_: x: x != null) config.packages.${p.pkg-name}.components));
761+
} // builtins.mapAttrs (n: _:
762+
final.lib.mkIf (config.packages ? ${p.pkg-name}) (final.lib.mkOverride 995 config.packages.${p.pkg-name}.${n}))
763+
(import ../modules/package-options.nix { inherit haskellLib; inherit (final) lib; }).options;
761764
}) (final.lib.filter (p: to-key p != p.pkg-name) plan-json.install-plan));
762765
})
763766
({lib, ...}: {

0 commit comments

Comments
 (0)