mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-28 16:42:09 +00:00
d2d7fed8ce
According to xsecurelock's configure.ac file, each of the add dependencies are used to: - libXrandr: XRandR provides information about monitor layouts and is strongly recommended on systems which can use more than one monitor (which includes most laptops). - libXext: The X Synchronization extension is used to get per-device idle times. Used by until_nonidle only. - libXScrnSaver: The X11 Screen Saver extension is used to turn off the screen saver when X11 handles screen blanking (e.g. via timeout) anyway. Saves CPU power. Adding libXrandr fixes an issue where locking a screen in a multi monitor setup results in the prompt information to not be in the middle of the screen. The other dependencies are not tested if they fixed something, however since upstream recommends than I think it is fair to include them also.
48 lines
1.2 KiB
Nix
48 lines
1.2 KiB
Nix
{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkgconfig
|
|
, libX11, libXcomposite, libXft, libXmu, libXrandr, libXext, libXScrnSaver
|
|
, pam, apacheHttpd, imagemagick, pamtester, xscreensaver, xset }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
name = "xsecurelock-${version}";
|
|
version = "1.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "google";
|
|
repo = "xsecurelock";
|
|
rev = "v${version}";
|
|
sha256 = "1vaw2m3yyfazj1x7xdwppmm0ch075q399g5vzrmhhrkzdrs53r1x";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
autoreconfHook pkgconfig
|
|
];
|
|
buildInputs = [
|
|
libX11 libXcomposite libXft libXmu libXrandr libXext libXScrnSaver
|
|
pam apacheHttpd imagemagick pamtester
|
|
];
|
|
|
|
configureFlags = [
|
|
"--with-pam-service-name=login"
|
|
"--with-xscreensaver=${xscreensaver}/libexec/xscreensaver"
|
|
];
|
|
|
|
preConfigure = ''
|
|
cat > version.c <<'EOF'
|
|
const char *const git_version = "${version}";
|
|
EOF
|
|
'';
|
|
|
|
preInstall = ''
|
|
substituteInPlace helpers/saver_blank \
|
|
--replace 'protect xset' 'protect ${xset}/bin/xset'
|
|
'';
|
|
|
|
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;
|
|
};
|
|
}
|