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 = {
enable = mkEnableOption "screenlock";
command = mkOption {
type = types.str;
default = "${pkgs.xlockmore}/bin/xlock -mode life1d -size 1";
type = types.path;
default = pkgs.writeDash "screenlock" ''
${pkgs.xlockmore}/bin/xlock -mode life1d -size 1
sleep 3
'';
};
};
imp = {
systemd.services.screenlock = {
before = [ "sleep.target" ];
wantedBy = [ "sleep.target" ];
requiredBy = [ "sleep.target" ];
environment = {
DISPLAY = ":${toString config.services.xserver.display}";
};