From 08de7bd96147bca47ee7428c620707cbb34cef9f Mon Sep 17 00:00:00 2001 From: nicoo Date: Wed, 27 Dec 2023 22:59:08 +0000 Subject: [PATCH] mpvScripts: Refactor `default.nix` It seems a bit easier to follow what is going on --- .../video/mpv/scripts/default.nix | 21 ++++++++++++------- 1 file 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 +]