about summary refs log tree commit diff
diff options
context:
space:
mode:
authornicoo <nicoo@mur.at>2023-12-27 23:08:17 +0000
committernicoo <nicoo@mur.at>2023-12-29 11:03:06 +0000
commitef51456d0f2b01674d62f658ff5f5b286e27d24b (patch)
tree9708a937a5f4d013344e832f7ed33ce772521c8b
parent08de7bd96147bca47ee7428c620707cbb34cef9f (diff)
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.
-rw-r--r--pkgs/applications/video/mpv/scripts/default.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/applications/video/mpv/scripts/default.nix b/pkgs/applications/video/mpv/scripts/default.nix
index 2c310cd410b6b..158a7c491007b 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
 ]