nixos-config/system/desktop/xlock.nix

42 lines
798 B
Nix
Raw Normal View History

2019-10-24 02:20:38 +02:00
{ lib, pkgs, ... }:
with lib;
let
name = "lock";
# desktop file
# ------------
# makes it possible to be used by other programs
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
'';
};
# the lock program
lockProgram =
pkgs.writeShellScriptBin "${name}" ''
${pkgs.xlockmore}/bin/xlock -mode life1d -size 1
'';
in {
environment.systemPackages = [
lockProgram
desktopFile
];
}