How to refer to a item of a list by index in NixOS configuration

I have some service configurations like:

      services.sftpgo.settings.httpd.bindings = [
        { address = "";
          port = 8080;

Is there a way to refer to the port number via something like, e.g. in the firewall settings, in nginx reverse-proxy etc.?

(elemAt 0).port

Alternatively some combination of map and filter if you don’t want a specific binding.


Thanks! So, I didn’t miss any implicit nix syntax for list indexing.
PS: Actually, (builtins.elemAt ….

1 Like

Yeah, most functional languages don’t