about summary refs log tree commit diff
path: root/nixos/modules/programs/wayland/lib.nix
blob: 0f275d3f18c565fc71bcd906fa6e0df8338aa592 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
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;
}