From 9712420a2cf4d93f835f75ab9a8b45e57717437d Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Wed, 14 Jan 2026 16:27:01 +0200 Subject: [PATCH] hyprland: use substituteInPlace in postPatch Allows us to be notified in case the `sed` expressions become irrelevant. --- pkgs/by-name/hy/hyprland/package.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/hy/hyprland/package.nix b/pkgs/by-name/hy/hyprland/package.nix index 8810cc91cff4..d21d7f572c96 100644 --- a/pkgs/by-name/hy/hyprland/package.nix +++ b/pkgs/by-name/hy/hyprland/package.nix @@ -103,11 +103,14 @@ customStdenv.mkDerivation (finalAttrs: { postPatch = '' # Fix hardcoded paths to /usr installation - sed -i "s#/usr#$out#" src/render/OpenGL.cpp + substituteInPlace src/render/OpenGL.cpp \ + --replace-fail /usr $out # Remove extra @PREFIX@ to fix pkg-config paths - sed -i "s#@PREFIX@/##g" hyprland.pc.in - sed -i "s#@PREFIX@/##g" example/hyprland.desktop.in + substituteInPlace hyprland.pc.in \ + --replace-fail @PREFIX@ "" + substituteInPlace example/hyprland.desktop.in \ + --replace-fail @PREFIX@ "" ''; # variables used by CMake, and shown in `hyprctl version`