pkgs.substitute
pkgs.substitute is a wrapper around the substitute Bash function in the standard environment.
It replaces strings in src as specified by the substitutions argument.
pkgs.replaceVars
pkgs.replaceVars <src> <replacements> replaces all instances of @varName@ (@s included) in file src with the respective value in the attribute set replacements.
pkgs.replaceVarsWith
pkgs.replaceVarsWith works the same way as pkgs.replaceVars, but additionally allows more options.