kodi: make withPackages and overrideAttrs composable

Using withPackage on a kodi derivation that was modified with overrideAttrs
lead to the modifications being discarded. With the previous adaptions to the
kodi derivation we can now modify the wrapper that allows using both
overrideAttrs and withPackage to form a custom kodi derivation with plugins.
This commit is contained in:
Daniel Wagenknecht 2023-01-06 23:11:59 +01:00 committed by Sergey Kazenyuk
parent 5935bf4daf
commit 2511f48e1c
1 changed files with 12 additions and 8 deletions

View File

@ -1,14 +1,18 @@
{ callPackage, ... } @ args:
let
unwrapped = callPackage ./unwrapped.nix (removeAttrs args [ "callPackage" ]);
kodiPackages = callPackage ../../../top-level/kodi-packages.nix { kodi = unwrapped; };
in
unwrapped.overrideAttrs (oldAttrs: {
passthru = oldAttrs.passthru // {
packages = kodiPackages;
withPackages = func: callPackage ./wrapper.nix {
kodi = unwrapped;
addons = kodiPackages.requiredKodiAddons (func kodiPackages);
};
};
passthru =
let
finalKodi = oldAttrs.passthru.kodi;
kodiPackages = callPackage ../../../top-level/kodi-packages.nix { kodi = finalKodi; };
in
oldAttrs.passthru // {
packages = kodiPackages;
withPackages = func: callPackage ./wrapper.nix {
kodi = finalKodi;
addons = kodiPackages.requiredKodiAddons (func kodiPackages);
};
};
})