maintainers/scripts/update.nix: use saner nubbing

This commit is contained in:
Jan Tojnar 2018-03-13 18:04:29 +01:00
parent 4f17851fb2
commit 2381bcd86f
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4

View File

@ -6,11 +6,22 @@
# TODO: add assert statements
let
/* Remove duplicate elements from the list based on some extracted value. O(n^2) complexity.
*/
nubOn = f: list:
if list == [] then
[]
else
let
x = pkgs.lib.head list;
xs = pkgs.lib.filter (p: f x != f p) (pkgs.lib.drop 1 list);
in
[x] ++ nubOn f xs;
pkgs = import ./../../default.nix { };
packagesWith = cond: return: set:
pkgs.lib.unique
nubOn (pkg: pkg.updateScript)
(pkgs.lib.flatten
(pkgs.lib.mapAttrsToList
(name: pkg: