From 8de8d4e228689a032784561c1815d3e4b20f8c1a Mon Sep 17 00:00:00 2001 From: BalrajSinghGidda Date: Fri, 20 Mar 2026 21:52:37 +0530 Subject: [PATCH] pwpwp --- modules/home-manager/programs/copilot-fix.nix | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/modules/home-manager/programs/copilot-fix.nix b/modules/home-manager/programs/copilot-fix.nix index a28c37b..18e105e 100644 --- a/modules/home-manager/programs/copilot-fix.nix +++ b/modules/home-manager/programs/copilot-fix.nix @@ -1,11 +1,20 @@ -{ pkgs, ... }: +{ pkgs }: pkgs.github-copilot-cli.overrideAttrs (old: { postFixup = (old.postFixup or "") + '' if [ -f "$out/bin/.copilot-wrapped" ]; then - echo "Patching copilot wrapper to remove --no-warnings..." - substituteInPlace "$out/bin/.copilot-wrapped" \ - --replace "--no-warnings" "" + echo "Patching copilot wrapper (binary-safe)..." + + tmpfile=$(mktemp) + + # remove the offending flag safely + cat "$out/bin/.copilot-wrapped" \ + | tr -d '\000' \ + | sed 's/--no-warnings//g' \ + > "$tmpfile" + + chmod +x "$tmpfile" + mv "$tmpfile" "$out/bin/.copilot-wrapped" fi ''; })