Stream: nix

Topic: Accessing list items in Nix


view this post on Zulip Andreas (Jun 14 2024 at 13:33):

Noob question: Is there no easier way to access list items than builtins.elemAt supplied with list and position?

Attribute sets are somewhat easier to handle I feel.

view this post on Zulip Tim DeHerrera (Jun 14 2024 at 13:45):

Usually you want to map over a list to do something with each item or fold it into a different data structure. Very rare that I need just a single item, but there is a lib function to access a list item based on equality somewhere iirc


Last updated: Nov 15 2024 at 12:33 UTC