Commit 2511f48e authored by Daniel Wagenknecht's avatar Daniel Wagenknecht Committed by Sergey Kazenyuk
Browse files

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.
parent 5935bf4d
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
{ 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 // {
    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 = unwrapped;
            kodi = finalKodi;
            addons = kodiPackages.requiredKodiAddons (func kodiPackages);
          };
        };