writeNginxConfig
pkgs.writers.writeNginxConfig
Functor
Docs pulled from | This Revision | 1 day 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
nginx-config-formatter
];
} # sh
''
printf "%s" "$text" | nginxfmt --max-empty-lines 0 - > $out
sed -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)
''