Antiquotation is supported in any paths except those in angle brackets. ./${foo}-${bar}.nix is a more convenient way of writing ./. + "/" + foo + "-" + bar + ".nix" or ./. + "/${foo}-${bar}.nix". At least one slash must appear before any antiquotations for this to be recognized as a path. a.${foo}/b.${bar} is a syntactically valid division operation. ./a.${foo}/b.${bar} is a path.
https://nixos.org/manual/nix/unstable/expressions/language-values.html