From 10013701bcae867baab4d534a5b69fa5bf62251c Mon Sep 17 00:00:00 2001 From: Mikael Voss Date: Sat, 24 Aug 2024 13:16:55 +0200 Subject: [PATCH] lib/flags: Use subtractLists for convenience --- lib/flags.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/flags.nix b/lib/flags.nix index 24884f9..c32f666 100644 --- a/lib/flags.nix +++ b/lib/flags.nix @@ -1,7 +1,8 @@ { nixpkgs, ... }: let - inherit (builtins) any filter isList isString stringLength; + inherit (builtins) filter isList isString stringLength; + inherit (nixpkgs.lib.lists) subtractLists; inherit (nixpkgs.lib.strings) addContextFrom; split = strOrList: @@ -15,7 +16,7 @@ let else toString list; in { remove = rem: strOrList: split strOrList - |> filter (flag: !any (elem: flag == elem) rem) + |> subtractLists rem |> remerge strOrList; subst = sub: strOrList: split strOrList