This commit is contained in:
Ingolf Wagner 2023-07-05 20:43:59 +02:00
parent 4816145c14
commit dadd3ef367
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
9 changed files with 121 additions and 70 deletions
nixos/components/gui/xorg

View file

@ -4,25 +4,6 @@ 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
@ -31,6 +12,14 @@ let
in
{
config = mkIf config.components.gui.enable {
environment.systemPackages = [ lockProgram desktopFile ];
environment.systemPackages = [
lockProgram
(pkgs.makeDesktopItem {
name = "lock";
desktopName = "lock";
exec = "${lockProgram}/bin/lock";
terminal = false;
})
];
};
}