mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
Merge pull request #11338 from obadz/light-locker
light-locker (lockscreen for lightdm)
This commit is contained in:
commit
35f8952a8c
@ -37,7 +37,7 @@ let
|
||||
# file provided by services.xserver.displayManager.session.script
|
||||
xsession = wm: dm: pkgs.writeScript "xsession"
|
||||
''
|
||||
#! /bin/sh
|
||||
#! ${pkgs.bash}/bin/bash
|
||||
|
||||
. /etc/profile
|
||||
cd "$HOME"
|
||||
|
@ -13,9 +13,16 @@ let
|
||||
# lightdm runs with clearenv(), but we need a few things in the enviornment for X to startup
|
||||
xserverWrapper = writeScript "xserver-wrapper"
|
||||
''
|
||||
#! /bin/sh
|
||||
#! ${pkgs.bash}/bin/bash
|
||||
${concatMapStrings (n: "export ${n}=\"${getAttr n xEnv}\"\n") (attrNames xEnv)}
|
||||
exec ${dmcfg.xserverBin} ${dmcfg.xserverArgs}
|
||||
|
||||
display=$(echo "$@" | xargs -n 1 | grep -P ^:\\d\$ | head -n 1 | sed s/^://)
|
||||
if [ -z "$display" ]
|
||||
then additionalArgs=":0 -logfile /var/log/X.0.log"
|
||||
else additionalArgs="-logfile /var/log/X.$display.log"
|
||||
fi
|
||||
|
||||
exec ${dmcfg.xserverBin} ${dmcfg.xserverArgs} $additionalArgs "$@"
|
||||
'';
|
||||
|
||||
usersConf = writeText "users.conf"
|
||||
@ -39,7 +46,6 @@ let
|
||||
greeter-session = ${cfg.greeter.name}
|
||||
${cfg.extraSeatDefaults}
|
||||
'';
|
||||
|
||||
in
|
||||
{
|
||||
# Note: the order in which lightdm greeter modules are imported
|
||||
@ -98,7 +104,6 @@ in
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
services.xserver.displayManager.slim.enable = false;
|
||||
|
||||
services.xserver.displayManager.job = {
|
||||
@ -149,5 +154,7 @@ in
|
||||
|
||||
services.xserver.displayManager.lightdm.background = mkDefault "${pkgs.nixos-artwork}/share/artwork/gnome/Gnome_Dark.png";
|
||||
|
||||
services.xserver.tty = null; # We might start multiple X servers so let the tty increment themselves..
|
||||
services.xserver.display = null; # We specify our own display (and logfile) in xserver-wrapper up there
|
||||
};
|
||||
}
|
||||
|
@ -381,13 +381,13 @@ in
|
||||
};
|
||||
|
||||
tty = mkOption {
|
||||
type = types.int;
|
||||
type = types.nullOr types.int;
|
||||
default = 7;
|
||||
description = "Virtual console for the X server.";
|
||||
};
|
||||
|
||||
display = mkOption {
|
||||
type = types.int;
|
||||
type = types.nullOr types.int;
|
||||
default = 0;
|
||||
description = "Display number for the X server.";
|
||||
};
|
||||
@ -517,11 +517,12 @@ in
|
||||
services.xserver.displayManager.xserverArgs =
|
||||
[ "-ac"
|
||||
"-terminate"
|
||||
"-logfile" "/var/log/X.${toString cfg.display}.log"
|
||||
"-config ${configFile}"
|
||||
":${toString cfg.display}" "vt${toString cfg.tty}"
|
||||
"-xkbdir" "${pkgs.xkeyboard_config}/etc/X11/xkb"
|
||||
] ++ optional (!cfg.enableTCP) "-nolisten tcp";
|
||||
] ++ optional (cfg.display != null) ":${tostring cfg.display}"
|
||||
++ optional (cfg.tty != null) "vt${toString cfg.tty}"
|
||||
++ optional (cfg.display != null) [ "-logfile" "/var/log/X.${toString cfg.display}.log" ]
|
||||
++ optional (!cfg.enableTCP) "-nolisten tcp";
|
||||
|
||||
services.xserver.modules =
|
||||
concatLists (catAttrs "modules" cfg.drivers) ++
|
||||
|
43
pkgs/misc/screensavers/light-locker/default.nix
Normal file
43
pkgs/misc/screensavers/light-locker/default.nix
Normal file
@ -0,0 +1,43 @@
|
||||
{ stdenv
|
||||
, fetchFromGitHub
|
||||
, which
|
||||
, xfce
|
||||
, glib
|
||||
, pkgconfig
|
||||
, libX11
|
||||
, gtk3
|
||||
, dbus_glib
|
||||
, systemd
|
||||
, wrapGAppsHook
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "${basename}-${version}";
|
||||
basename = "light-locker";
|
||||
version = "1.7.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "the-cavalry";
|
||||
repo = basename;
|
||||
rev = "v${version}";
|
||||
sha256 = "0ygkp5vgkx2nfhfql6j2jsfay394gda23ir3sx4f72j4agsirjvj";
|
||||
};
|
||||
|
||||
buildInputs = [ which xfce.xfce4_dev_tools glib pkgconfig libX11 gtk3 dbus_glib systemd wrapGAppsHook ];
|
||||
|
||||
preConfigure = ''
|
||||
./autogen.sh
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = https://github.com/the-cavalry/light-locker;
|
||||
description = "light-locker is a simple locker";
|
||||
longDescription = ''
|
||||
light-locker is a simple locker (forked from gnome-screensaver) that aims to have simple, sane, secure defaults and be well integrated with the desktop while not carrying any desktop-specific dependencies.
|
||||
It relies on lightdm for locking and unlocking your session via ConsoleKit/UPower or logind/systemd.
|
||||
'';
|
||||
license = licenses.gpl2;
|
||||
maintainers = with maintainers; [ obadz ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
@ -7752,6 +7752,8 @@ let
|
||||
|
||||
lightning = callPackage ../development/libraries/lightning { };
|
||||
|
||||
lightlocker = callPackage ../misc/screensavers/light-locker { };
|
||||
|
||||
lirc = callPackage ../development/libraries/lirc { };
|
||||
|
||||
liquidfun = callPackage ../development/libraries/liquidfun { };
|
||||
|
Loading…
Reference in New Issue
Block a user