Skip to content

Commit

Permalink
Slightly better default overlay declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
kip93 committed Oct 22, 2023
1 parent e02e541 commit 3c0b7f7
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions lib/functions/import/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,14 @@ rec {
let
overlays = asAttrs' { inherit apply path; };
in
if overlays ? default then
overlays
else
overlays // {
default = final: prev:
builtins.foldl'
(x: y: x // (y final (prev // x)))
{ }
(builtins.attrValues overlays)
;
}
overlays // {
default = overlays.default or (final: prev:
builtins.foldl'
(x: y: x // (y final (prev // x)))
{ }
(builtins.attrValues overlays)
);
}
;

# Locate importable paths in a directory, and import them as packages.
Expand Down

0 comments on commit 3c0b7f7

Please sign in to comment.