diff --git a/pkgs/by-name/tr/treefmt/modules/wrapper.nix b/pkgs/by-name/tr/treefmt/modules/wrapper.nix index b394912ce0b1..2d1a7b6d58c9 100644 --- a/pkgs/by-name/tr/treefmt/modules/wrapper.nix +++ b/pkgs/by-name/tr/treefmt/modules/wrapper.nix @@ -31,10 +31,15 @@ wrapper = finalAttrs.finalPackage; }; }; - postBuild = '' - wrapProgram "$out/bin/treefmt" \ - --prefix PATH : "$binPath" \ - --add-flags "--config-file $configFile" - ''; + postBuild = + let + wrapPrefixPathArgument = lib.optionalString ( + config.runtimeInputs != [ ] + ) "--prefix PATH : \"$binPath\""; + in + '' + wrapProgram "$out/bin/treefmt" \ + --add-flags "--config-file $configFile " ${wrapPrefixPathArgument} + ''; }); }