about summary refs log tree commit diff
path: root/nixos/modules/programs/wayland/lib.nix
diff options
context:
space:
mode:
authorMaëlys Bras de fer <mae.bdf@outlook.com>2024-05-22 20:01:05 +0200
committerMaëlys Bras de fer <mae.bdf@outlook.com>2024-05-22 20:01:05 +0200
commit95674de399b4c880f16059f8e2ce84e7388842d8 (patch)
tree36a6d762b405ffe35ced9cd18836cb391b688142 /nixos/modules/programs/wayland/lib.nix
parentbcbeccfa7d3fff2203ddfd4a2e4b8ba0f1f38584 (diff)
nixos/{river,hyprland}: override package using apply
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;
+}