writeNginxConfig
pkgs.writers.writeNginxConfig
Functor
Docs pulled from | This Revision | 29 minutes ago
Contribute
Enhance the ecosystem with your expertise! Contribute to fill the gaps in documentation. Your input can make a difference.
Noogle detected
This is a Functor
Learn about functors
Implementation
The following is the current implementation of this function.
name: text:
pkgs.runCommandLocal name
{
inherit text;
__structuredAttrs = true;
nativeBuildInputs = [ gixy ];
} # sh
''
printf "%s" "$text" | ${lib.getExe pkgs.nginx-config-formatter} --max-empty-lines 0 - > $out
${lib.getExe pkgs.gnused} -i 's/ ;/;/g' $out
gixy $out || (echo "\n\nThis can be caused by combining multiple incompatible services on the same hostname.\n\nFull merged config:\n\n"; cat $out; exit 1)
''