about summary refs log tree commit diff
path: root/pkgs/applications/video/mpv
diff options
context:
space:
mode:
authornicoo <nicoo@mur.at>2023-12-27 22:59:08 +0000
committernicoo <nicoo@mur.at>2023-12-29 11:03:05 +0000
commit08de7bd96147bca47ee7428c620707cbb34cef9f (patch)
tree6158f8947fa26282b6635ec657bb9872bc4afd6a /pkgs/applications/video/mpv
parent614afa6014f7d289f606c46c6840c81976948a3a (diff)
downloadnixlib-08de7bd96147bca47ee7428c620707cbb34cef9f.tar
nixlib-08de7bd96147bca47ee7428c620707cbb34cef9f.tar.gz
nixlib-08de7bd96147bca47ee7428c620707cbb34cef9f.tar.bz2
nixlib-08de7bd96147bca47ee7428c620707cbb34cef9f.tar.lz
nixlib-08de7bd96147bca47ee7428c620707cbb34cef9f.tar.xz
nixlib-08de7bd96147bca47ee7428c620707cbb34cef9f.tar.zst
nixlib-08de7bd96147bca47ee7428c620707cbb34cef9f.zip
mpvScripts: Refactor `default.nix`
It seems a bit easier to follow what is going on
Diffstat (limited to 'pkgs/applications/video/mpv')
-rw-r--r--pkgs/applications/video/mpv/scripts/default.nix21
1 files changed, 14 insertions, 7 deletions
diff --git a/pkgs/applications/video/mpv/scripts/default.nix b/pkgs/applications/video/mpv/scripts/default.nix
index 98860e1f2cba..2c310cd410b6 100644
--- a/pkgs/applications/video/mpv/scripts/default.nix
+++ b/pkgs/applications/video/mpv/scripts/default.nix
@@ -54,10 +54,9 @@ let
         '';
       })
     ]; }; });
-in
 
-lib.recurseIntoAttrs (lib.makeScope newScope (self:
-  let inherit (self) callPackage;
+  scope = self: let
+    inherit (self) callPackage;
   in lib.mapAttrs addTests {
     inherit (callPackage ./mpv.nix { })
       acompressor autocrop autodeint autoload;
@@ -83,7 +82,15 @@ lib.recurseIntoAttrs (lib.makeScope newScope (self:
     visualizer = callPackage ./visualizer.nix { };
     vr-reversal = callPackage ./vr-reversal.nix { };
     webtorrent-mpv-hook = callPackage ./webtorrent-mpv-hook.nix { };
-  }
-  // lib.optionalAttrs config.allowAliases {
-  youtube-quality = throw "'youtube-quality' is no longer maintained, use 'quality-menu' instead"; # added 2023-07-14
-  }))
+  };
+
+  aliases = lib.optionalAttrs config.allowAliases {
+    youtube-quality = throw "'youtube-quality' is no longer maintained, use 'quality-menu' instead"; # added 2023-07-14
+  };
+in
+
+with lib; pipe scope [
+  (makeScope newScope)
+  (attrsets.unionOfDisjoint aliases)
+  recurseIntoAttrs
+]