nurfz
December 20, 2023, 1:38pm
1
I have some service configurations like:
services.sftpgo.settings.httpd.bindings = [
{ address = "0.0.0.0";
port = 8080;
}
];
Is there a way to refer to the port number via something like config.services.sftpgo.settings.httpd.bindings.0.port
, e.g. in the firewall settings, in nginx reverse-proxy etc.?
TLATER
December 20, 2023, 2:22pm
2
(elemAt config.services.sftpgo.settings.httpd.bindings 0).port
Alternatively some combination of map
and filter
if you don’t want a specific binding.
3 Likes
nurfz
December 20, 2023, 3:07pm
3
Thanks! So, I didn’t miss any implicit nix syntax for list indexing.
PS: Actually, (builtins.elemAt …
.
1 Like
TLATER
December 20, 2023, 7:04pm
4
Yeah, most functional languages don’t