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.
This commit is contained in:
nicoo
2023-12-29 11:03:06 +00:00
parent 08de7bd961
commit ef51456d0f
@@ -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
]