From 8101dc14557f5375ee8e3c56b92e9ca73ed1f1cc Mon Sep 17 00:00:00 2001 From: kyehn Date: Wed, 10 Sep 2025 19:06:26 +0800 Subject: [PATCH] thinkfan: use --replace-fail --- pkgs/by-name/th/thinkfan/package.nix | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/th/thinkfan/package.nix b/pkgs/by-name/th/thinkfan/package.nix index bae3afa31acb..57347b91052d 100644 --- a/pkgs/by-name/th/thinkfan/package.nix +++ b/pkgs/by-name/th/thinkfan/package.nix @@ -7,7 +7,6 @@ yaml-cpp, pkg-config, procps, - coreutils, smartSupport ? false, libatasmart, }: @@ -23,17 +22,19 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-QqDWPOXy8E+TY5t0fFRAS8BGA7ZH90xecv5UsFfDssk="; }; - postPatch = '' - # fix hardcoded install path - substituteInPlace CMakeLists.txt --replace /etc $out/etc - - # fix command paths in unit files - for unit in rcscripts/systemd/*; do - substituteInPlace "$unit" \ - --replace /bin/kill ${procps}/bin/kill \ - --replace /usr/bin/pkill ${procps}/bin/pkill \ - --replace /usr/bin/sleep ${coreutils}/bin/sleep - done + postPatch = # fix hardcoded install path + '' + substituteInPlace CMakeLists.txt \ + --replace-fail "/etc" "$out/etc" + '' + # fix command paths in unit files + + '' + substituteInPlace rcscripts/systemd/thinkfan-sleep.service \ + --replace-fail "/usr/bin/pkill" "${lib.getExe' procps "pkill"}" + substituteInPlace rcscripts/systemd/thinkfan-wakeup.service \ + --replace-fail "/usr/bin/pkill" "${lib.getExe' procps "pkill"}" + substituteInPlace rcscripts/systemd/thinkfan.service.cmake \ + --replace-fail "/bin/kill" "${lib.getExe' procps "kill"}" ''; cmakeFlags = [