gtklock-powerbar-module: Fix systemctl command paths (#418468)

This commit is contained in:
Aleksana
2025-06-21 02:10:02 +08:00
committed by GitHub
@@ -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 = {