From 440110b83ffe8391e726dfa8efa83c229372a779 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Sat, 2 May 2020 16:36:49 -0700 Subject: [PATCH] nixpkgs-fmt: fix erroneous debug output (#86335) Prior to this, when used in conjunction with e.g. `format-all-mode`, garbage like node: NODE_STRING@[8934; 9139), indent: IndentLevel { level: 3, alignment: 0 } would be written to the file. --- pkgs/tools/nix/nixpkgs-fmt/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/nix/nixpkgs-fmt/default.nix b/pkgs/tools/nix/nixpkgs-fmt/default.nix index b95bb46a844..b55ac647b35 100644 --- a/pkgs/tools/nix/nixpkgs-fmt/default.nix +++ b/pkgs/tools/nix/nixpkgs-fmt/default.nix @@ -1,4 +1,4 @@ -{ lib, rustPlatform, fetchFromGitHub }: +{ lib, rustPlatform, fetchFromGitHub, fetchpatch }: rustPlatform.buildRustPackage rec { pname = "nixpkgs-fmt"; version = "0.8.0"; @@ -10,6 +10,15 @@ rustPlatform.buildRustPackage rec { sha256 = "09lhi8aidw9qf94n07mgs2nfac32a96wkx50glj35dhn06iwzwqr"; }; + patches = [ + # Fixes debug output on stdout mangling some files. Fixed in next release. + # https://github.com/nix-community/nixpkgs-fmt/issues/201 + (fetchpatch { + url = "https://github.com/nix-community/nixpkgs-fmt/commit/648f46e1d5507592b246311618f467da282bf1b5.patch"; + sha256 = "18n4criyl0lydxmjqfkcmwx0pniyqzfgfxcjwz6czqwmx5y7b4rb"; + }) + ]; + cargoSha256 = "15m40d9354412h51zn806pxsqjai48xiw8chf8slbi0cjxd268j9"; meta = with lib; {