mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 04:50:21 +00:00
nixos/prometheus: use lib.filterAttrs
This commit is contained in:
@@ -113,20 +113,7 @@ let
|
||||
filterAttrsListRecursive =
|
||||
pred: x:
|
||||
if isAttrs x then
|
||||
listToAttrs (
|
||||
concatMap (
|
||||
name:
|
||||
let
|
||||
v = x.${name};
|
||||
in
|
||||
if pred name v then
|
||||
[
|
||||
(nameValuePair name (filterAttrsListRecursive pred v))
|
||||
]
|
||||
else
|
||||
[ ]
|
||||
) (attrNames x)
|
||||
)
|
||||
mapAttrs (_: filterAttrsListRecursive pred) (filterAttrs pred x)
|
||||
else if isList x then
|
||||
map (filterAttrsListRecursive pred) x
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user