How to check if a list contains a string?

How is someone supposed to check if a Nix list contains a string?

I’ve searched Nixpkgs, the Nix Manual, the NixOS Wiki, and this forum for the answer, to no avail.

2 Likes

Use the builtins.elem function, like builtins.elem "a" ["a" "b"] # => true

7 Likes