l screenlock: fix screen sometimes not locking

This commit is contained in:
lassulus 2019-04-07 19:31:44 +02:00
parent 23f5563134
commit 9e7729def5

View File

@ -13,15 +13,18 @@ let
api = { api = {
enable = mkEnableOption "screenlock"; enable = mkEnableOption "screenlock";
command = mkOption { command = mkOption {
type = types.str; type = types.path;
default = "${pkgs.xlockmore}/bin/xlock -mode life1d -size 1"; default = pkgs.writeDash "screenlock" ''
${pkgs.xlockmore}/bin/xlock -mode life1d -size 1
sleep 3
'';
}; };
}; };
imp = { imp = {
systemd.services.screenlock = { systemd.services.screenlock = {
before = [ "sleep.target" ]; before = [ "sleep.target" ];
wantedBy = [ "sleep.target" ]; requiredBy = [ "sleep.target" ];
environment = { environment = {
DISPLAY = ":${toString config.services.xserver.display}"; DISPLAY = ":${toString config.services.xserver.display}";
}; };