From ef51456d0f2b01674d62f658ff5f5b286e27d24b Mon Sep 17 00:00:00 2001 From: nicoo Date: Wed, 27 Dec 2023 23:08:17 +0000 Subject: [PATCH] mpvScripts: Immediately error on collisions between `scope` and `aliases` This makes mistakes more obvious, and ensures the error happens independently of config.allowAliases, so any build will catch it. --- pkgs/applications/video/mpv/scripts/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/video/mpv/scripts/default.nix b/pkgs/applications/video/mpv/scripts/default.nix index 2c310cd410b6..158a7c491007 100644 --- a/pkgs/applications/video/mpv/scripts/default.nix +++ b/pkgs/applications/video/mpv/scripts/default.nix @@ -84,13 +84,15 @@ let webtorrent-mpv-hook = callPackage ./webtorrent-mpv-hook.nix { }; }; - aliases = lib.optionalAttrs config.allowAliases { + aliases = { 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) + (self: + assert builtins.intersectAttrs self aliases == {}; + self // optionalAttrs config.allowAliases aliases) recurseIntoAttrs ]