diff --git a/pkgs/by-name/ch/chawan/package.nix b/pkgs/by-name/ch/chawan/package.nix index ce320d7d167e..cf5c642e87e1 100644 --- a/pkgs/by-name/ch/chawan/package.nix +++ b/pkgs/by-name/ch/chawan/package.nix @@ -26,12 +26,14 @@ stdenv.mkDerivation { fetchSubmodules = true; }; - patches = [ - # Include chawan's man pages in mancha's search path - (replaceVars ./mancha-augment-path.diff { - out = placeholder "out"; - }) - ]; + patches = [ ./mancha-augment-path.diff ]; + + # Include chawan's man pages in mancha's search path + postPatch = '' + # As we need the $out reference, we can't use `replaceVars` here. + substituteInPlace adapter/protocol/man.nim \ + --replace-fail '@out@' "$out" + ''; env.NIX_CFLAGS_COMPILE = toString ( lib.optional stdenv.cc.isClang "-Wno-error=implicit-function-declaration" diff --git a/pkgs/by-name/gu/gui-for-clash/package.nix b/pkgs/by-name/gu/gui-for-clash/package.nix index 402e3ba6cb4e..84d01efb1640 100644 --- a/pkgs/by-name/gu/gui-for-clash/package.nix +++ b/pkgs/by-name/gu/gui-for-clash/package.nix @@ -68,11 +68,13 @@ in buildGoModule { inherit pname version src; - patches = [ - (replaceVars ./bridge.patch { - basepath = placeholder "out"; - }) - ]; + patches = [ ./bridge.patch ]; + + postPatch = '' + # As we need the $out reference, we can't use `replaceVars` here. + substituteInPlace bridge/bridge.go \ + --replace-fail '@basepath@' "$out" + ''; vendorHash = "sha256-OrysyJF+lUMf+0vWmOZHjxUdE6fQCKArmpV4alXxtYs="; diff --git a/pkgs/by-name/gu/gui-for-singbox/package.nix b/pkgs/by-name/gu/gui-for-singbox/package.nix index 08620f978925..f69c6461165e 100644 --- a/pkgs/by-name/gu/gui-for-singbox/package.nix +++ b/pkgs/by-name/gu/gui-for-singbox/package.nix @@ -68,11 +68,13 @@ in buildGoModule { inherit pname version src; - patches = [ - (replaceVars ./bridge.patch { - basepath = placeholder "out"; - }) - ]; + patches = [ ./bridge.patch ]; + + postPatch = '' + # As we need the $out reference, we can't use `replaceVars` here. + substituteInPlace bridge/bridge.go \ + --replace-fail '@basepath@' "$out" + ''; vendorHash = "sha256-OrysyJF+lUMf+0vWmOZHjxUdE6fQCKArmpV4alXxtYs=";