nixpkgs-suyu/pkgs/tools/X11/xsecurelock/default.nix
Vincent Ambo 1bdceb9628 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.
2022-01-07 17:48:50 +01:00

47 lines
1.2 KiB
Nix

{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config
, libX11, libXcomposite, libXft, libXmu, libXrandr, libXext, libXScrnSaver
, pam, apacheHttpd, pamtester, xscreensaver, coreutils, makeWrapper }:
stdenv.mkDerivation rec {
pname = "xsecurelock";
version = "1.7.0";
src = fetchFromGitHub {
owner = "google";
repo = "xsecurelock";
rev = "v${version}";
sha256 = "020y2mi4sshc5dghcz37aj5wwizbg6712rzq2a72f8z8m7mnxr5y";
};
nativeBuildInputs = [
autoreconfHook pkg-config makeWrapper
];
buildInputs = [
libX11 libXcomposite libXft libXmu libXrandr libXext libXScrnSaver
pam apacheHttpd pamtester
];
configureFlags = [
"--with-pam-service-name=login"
"--with-xscreensaver=${xscreensaver}/libexec/xscreensaver"
];
preConfigure = ''
cat > version.c <<'EOF'
const char *const git_version = "${version}";
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";
license = licenses.asl20;
maintainers = with maintainers; [ fpletz ];
platforms = platforms.unix;
};
}