about summary refs log tree commit diff
path: root/pkgs/applications/video/kodi
diff options
context:
space:
mode:
authorDaniel Wagenknecht <dwagenk@mailbox.org>2023-01-06 23:11:59 +0100
committerSergey Kazenyuk <kazenyuk@pm.me>2024-04-17 19:04:46 +0300
commit2511f48e1ccff1c2f7c17b405a861f729aa2b4bf (patch)
treeef98c13afb222a027974a112167c0879ad02f48b /pkgs/applications/video/kodi
parent5935bf4daf8b18e937d68400b80974acc03753a6 (diff)
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.
Diffstat (limited to 'pkgs/applications/video/kodi')
-rw-r--r--pkgs/applications/video/kodi/default.nix20
1 files changed, 12 insertions, 8 deletions
diff --git a/pkgs/applications/video/kodi/default.nix b/pkgs/applications/video/kodi/default.nix
index 3f382efff11b9..b028558a61da7 100644
--- a/pkgs/applications/video/kodi/default.nix
+++ b/pkgs/applications/video/kodi/default.nix
@@ -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);
+          };
+        };
   })