git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit1bdceb96281f9146585ac80a12de8cb9858179a8 authorVincent Ambo <mail@tazj.in> dateFri 7 Jan 2022, 15:09 (5 years ago) parent3980514
1 file changed+7−2
pkgs/tools/X11/xsecurelock/default.nix+7−2
pkgs/tools/X11/xsecurelock/default.nix+7−2
@@ -1,6 +1,6 @@
11{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config
22, libX11, libXcomposite, libXft, libXmu, libXrandr, libXext, libXScrnSaver
3−, pam, apacheHttpd, pamtester, xscreensaver }:
3+, pam, apacheHttpd, pamtester, xscreensaver, coreutils, makeWrapper }:
44
55stdenv.mkDerivation rec {
66 pname = "xsecurelock";
@@ -14,8 +14,9 @@ stdenv.mkDerivation rec {
1414 };
1515
1616 nativeBuildInputs = [
17− autoreconfHook pkg-config
17+ autoreconfHook pkg-config makeWrapper
1818 ];
19+
1920 buildInputs = [
2021 libX11 libXcomposite libXft libXmu libXrandr libXext libXScrnSaver
2122 pam apacheHttpd pamtester
@@ -32,6 +33,10 @@ stdenv.mkDerivation rec {
3233 EOF
3334 '';
3435
36+ postInstall = ''
37+ wrapProgram $out/libexec/xsecurelock/saver_blank --prefix PATH : ${coreutils}/bin
38+ '';
39+
3540 meta = with lib; {
3641 description = "X11 screen lock utility with security in mind";
3742 homepage = "https://github.com/google/xsecurelock";