mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
nixos/nginx: use structuredAttrs instead of passAsFile in writeNginxConfig
This commit is contained in:
@@ -1100,12 +1100,11 @@ rec {
|
||||
pkgs.runCommandLocal name
|
||||
{
|
||||
inherit text;
|
||||
passAsFile = [ "text" ];
|
||||
__structuredAttrs = true;
|
||||
nativeBuildInputs = [ gixy ];
|
||||
} # sh
|
||||
''
|
||||
cp "$textPath" $out
|
||||
${lib.getExe pkgs.nginx-config-formatter} --max-empty-lines 0 $out
|
||||
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)
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user