2019-12-20 05:54:26 +01:00
|
|
|
{ lib, pkgs, ... }:
|
2019-10-24 02:20:38 +02:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
name = "lock";
|
|
|
|
|
|
|
|
# desktop file
|
|
|
|
# ------------
|
|
|
|
# makes it possible to be used by other programs
|
2019-12-20 05:54:26 +01:00
|
|
|
desktopFile = pkgs.writeTextFile {
|
|
|
|
name = "${name}.desktop";
|
|
|
|
destination = "/share/applications/${name}.desktop";
|
|
|
|
text = ''
|
|
|
|
[Desktop Entry]
|
|
|
|
Categories=Application;Utility;
|
|
|
|
Comment=Screen Saver
|
|
|
|
Encoding=UTF-8
|
|
|
|
Exec=${lockProgram}/bin/${name}
|
|
|
|
Icon=gnome-lockscreen
|
|
|
|
Name=${name}
|
|
|
|
Terminal=false
|
|
|
|
Type=Application
|
|
|
|
'';
|
|
|
|
};
|
2019-10-24 02:20:38 +02:00
|
|
|
|
|
|
|
# the lock program
|
2019-12-20 05:54:26 +01:00
|
|
|
lockProgram = pkgs.writeShellScriptBin "${name}" ''
|
|
|
|
${pkgs.xlockmore}/bin/xlock -mode life1d -size 1
|
|
|
|
'';
|
2019-10-24 02:20:38 +02:00
|
|
|
|
2021-11-01 09:20:42 +01:00
|
|
|
in
|
|
|
|
{
|
2019-10-24 02:20:38 +02:00
|
|
|
|
2019-12-20 05:54:26 +01:00
|
|
|
environment.systemPackages = [ lockProgram desktopFile ];
|
2019-10-24 02:20:38 +02:00
|
|
|
}
|