xsecurelock: add coreutils to saver_blank script path

This script is used to delay something in a loop that is active while
xscreensaver is running.

Since it calls `sleep` from coreutils, the effect of `sleep` not being
on $PATH is that it turns into a busy loop that does nothing, causing
a variety of problems with things like resuming from suspend if a
screenlocker is active.

Situations where coreutils might not be on $PATH are, for example,
cases where xscreensaver is launched via a systemd-unit (e.g. through
xss-lock).

I've been running xsecurelock with this change for a while (since
https://cl.tvl.fyi/c/depot/+/4403) and it has resolved these issues
for me.
This commit is contained in:
Vincent Ambo 2022-01-07 15:09:31 +03:00 committed by sterni
parent 3980514793
commit 1bdceb9628

View File

@ -1,6 +1,6 @@
{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config
, libX11, libXcomposite, libXft, libXmu, libXrandr, libXext, libXScrnSaver
, pam, apacheHttpd, pamtester, xscreensaver }:
, pam, apacheHttpd, pamtester, xscreensaver, coreutils, makeWrapper }:
stdenv.mkDerivation rec {
pname = "xsecurelock";
@ -14,8 +14,9 @@ stdenv.mkDerivation rec {
};
nativeBuildInputs = [
autoreconfHook pkg-config
autoreconfHook pkg-config makeWrapper
];
buildInputs = [
libX11 libXcomposite libXft libXmu libXrandr libXext libXScrnSaver
pam apacheHttpd pamtester
@ -32,6 +33,10 @@ stdenv.mkDerivation rec {
EOF
'';
postInstall = ''
wrapProgram $out/libexec/xsecurelock/saver_blank --prefix PATH : ${coreutils}/bin
'';
meta = with lib; {
description = "X11 screen lock utility with security in mind";
homepage = "https://github.com/google/xsecurelock";