lib/packages: Simplify remove function

This commit is contained in:
Mikael 2024-08-24 14:00:52 +02:00
parent 10013701bc
commit 9f88828284
Signed by: mikael
SSH key fingerprint: SHA256:21QyD2Meiot7jOUVitIR5YkGB/XuXdCvLW1hE6dsri0

View file

@ -1,9 +1,9 @@
{ nixpkgs, ... }:
let
inherit (builtins) any filter;
inherit (builtins) elem filter;
inherit (nixpkgs.lib.strings) getName;
in {
remove = nameList: pkgList:
filter (pkg: !any (elem: getName pkg == elem) nameList) pkgList;
filter (pkg: !elem (getName pkg) nameList) pkgList;
}