NixOS/nixpkgs — pull request #4145 by abbradar (2014-09-18 14:48:10+00:00)
Title: Add recursive directory substitution support to substituteAll

This allows, for instance, to write complex modular configuration files with substitutions and then use them as such (for nginx):
```
services.nginx.config = let
configs = pkgs.substituteAll {
src = ./nginx;

nginx = pkgs.nginx;
inherit phpfpm_sock;
};
in "include ${configs}/nginx.conf;";
```