lib/flags: Use subtractLists for convenience
This commit is contained in:
parent
3f276c26af
commit
10013701bc
1 changed files with 3 additions and 2 deletions
|
@ -1,7 +1,8 @@
|
||||||
{ nixpkgs, ... }:
|
{ nixpkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (builtins) any filter isList isString stringLength;
|
inherit (builtins) filter isList isString stringLength;
|
||||||
|
inherit (nixpkgs.lib.lists) subtractLists;
|
||||||
inherit (nixpkgs.lib.strings) addContextFrom;
|
inherit (nixpkgs.lib.strings) addContextFrom;
|
||||||
|
|
||||||
split = strOrList:
|
split = strOrList:
|
||||||
|
@ -15,7 +16,7 @@ let
|
||||||
else toString list;
|
else toString list;
|
||||||
in {
|
in {
|
||||||
remove = rem: strOrList: split strOrList
|
remove = rem: strOrList: split strOrList
|
||||||
|> filter (flag: !any (elem: flag == elem) rem)
|
|> subtractLists rem
|
||||||
|> remerge strOrList;
|
|> remerge strOrList;
|
||||||
|
|
||||||
subst = sub: strOrList: split strOrList
|
subst = sub: strOrList: split strOrList
|
||||||
|
|
Loading…
Reference in a new issue