gtklock-powerbar-module: Fix systemctl command paths

Replace hardcoded "systemctl" commands with full store paths to ensure
the module works correctly in NixOS environments.
This commit is contained in:
Mostafa Khaled
2025-06-20 19:22:22 +03:00
parent b22295153c
commit 493b704080
@@ -7,6 +7,7 @@
pkg-config,
gtk3,
gtklock,
systemd,
}:
stdenv.mkDerivation (finalAttrs: {
@@ -28,6 +29,17 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [ gtk3 ];
postPatch =
let
systemctl = lib.getExe' systemd "systemctl";
in
''
substituteInPlace source.c \
--replace-fail '"systemctl reboot"' '"${systemctl} reboot"' \
--replace-fail '"systemctl -i poweroff"' '"${systemctl} -i poweroff"' \
--replace-fail '"systemctl suspend"' '"${systemctl} suspend"'
'';
passthru.tests.testModule = gtklock.testModule finalAttrs.finalPackage;
meta = {