about summary refs log tree commit diff
path: root/nixos/modules/programs/wayland/lib.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/programs/wayland/lib.nix')
-rw-r--r--nixos/modules/programs/wayland/lib.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/nixos/modules/programs/wayland/lib.nix b/nixos/modules/programs/wayland/lib.nix
new file mode 100644
index 0000000000000..0f275d3f18c56
--- /dev/null
+++ b/nixos/modules/programs/wayland/lib.nix
@@ -0,0 +1,12 @@
+{ lib }:
+
+{
+  genFinalPackage = pkg: args:
+    let
+      expectedArgs = with lib;
+        lib.naturalSort (lib.attrNames args);
+      existingArgs = with lib;
+        naturalSort (intersectLists expectedArgs (attrNames (functionArgs pkg.override)));
+    in
+      if existingArgs != expectedArgs then pkg else pkg.override args;
+}