fix(overlay): properly merge namespaced packages

This commit is contained in:
Jake Hamilton 2022-09-09 15:43:18 -07:00
parent 2f1ad83150
commit 8141ee43d8
No known key found for this signature in database
GPG key ID: 9762169A1B35EA68
2 changed files with 24 additions and 27 deletions

View file

@ -25,7 +25,7 @@ in
user-packages-overlay = final: prev:
let
user-packages = snowfall-lib.package.create-packages {
pkgs = prev;
pkgs = final;
channels = channels;
};
user-packages-without-default = builtins.removeAttrs
@ -33,17 +33,11 @@ in
in
if overlay-package-namespace == null then
user-packages-without-default
else if prev ? "${overlay-package-namespace}" then
{
${overlay-package-namespace} =
snowfall-lib.attrs.merge-deep [
prev.${overlay-package-namespace}
user-packages-without-default
];
}
else
{
${overlay-package-namespace} = user-packages-without-default;
${overlay-package-namespace} =
(prev.${overlay-package-namespace} or { })
// user-packages-without-default;
};
overlays = [ user-packages-overlay ] ++ extra-overlays ++ (builtins.map create-overlay user-overlays);
in