about summary refs log tree commit diff
path: root/nixos/modules/programs/wayland/lib.nix
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2024-05-26 22:06:53 +0200
committerGitHub <noreply@github.com>2024-05-26 22:06:53 +0200
commitf33f71f6f690db1a2f0776d6711cf6f6df2db021 (patch)
tree337153bcd44b14d254a78307696191c947b00528 /nixos/modules/programs/wayland/lib.nix
parent7173eb87b8720da79989bbf1ed1fa72465323778 (diff)
parent95674de399b4c880f16059f8e2ce84e7388842d8 (diff)
Merge pull request #240989 from m-bdf/hyprland-wayland-session
nixos/{sway,river,hyprland}: improve common wayland-session module
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;
+}