Skip to content

Commit 77f7f58

Browse files
authored
Allow order independent overlays (#2043)
Currently the haskell.nix overlays ignore any `defaultModules` and `extraPkgconfigMappings` set in `prev`. This means it is not possible to have an overly include these in an way that will work both before and after the haskell.nix overlays. With this change an overlay can be written like this: ``` final: prev: { haskell-nix = prev.haskell-nix or {} // { extraPkgconfigMappings = prev.haskell-nix.extraPkgconfigMappings or {} // { ... ``` It can then be included before or after the haskell.nix overlays.
1 parent 4b53a75 commit 77f7f58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

overlays/haskell.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ final: prev: {
99
# Default modules, these will always be included.
1010
# They are here to be overridden/added to by other
1111
# overlays.
12-
defaultModules = [];
12+
defaultModules = prev.haskell-nix.defaultModules or [];
1313

1414
# Additional user-provided mappings to augment ./../lib/pkgconf-nixpkgs-map.nix
15-
extraPkgconfigMappings = {};
15+
extraPkgconfigMappings = prev.haskell-nix.extraPkgconfigMappings or {};
1616
# Nix Flake based source pins.
1717
# To update all inputs, get unstable Nix and then `nix flake update --recreate-lock-file`
1818
# Or `nix-shell -p nixUnstable --run "nix --experimental-features 'nix-command flakes' flake update --recreate-lock-file"`

0 commit comments

Comments
 (0)