From a95a506991b11447a02eb5298027d40634c9ac12 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sat, 30 May 2026 14:48:20 +0200 Subject: [PATCH] nixos/nginx: use structuredAttrs instead of passAsFile in writeNginxConfig --- pkgs/build-support/writers/scripts.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/writers/scripts.nix b/pkgs/build-support/writers/scripts.nix index 560681e4c4ae..01afb249d407 100644 --- a/pkgs/build-support/writers/scripts.nix +++ b/pkgs/build-support/writers/scripts.nix @@ -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) '';