nixos-config/nixos/components/gui/xorg/xlock.nix
2024-05-03 23:43:26 +02:00

25 lines
480 B
Nix

{ lib, pkgs, config, ... }:
with lib;
let
name = "lock";
# the lock program
lockProgram = pkgs.writeShellScriptBin "${name}" ''
${pkgs.xlockmore}/bin/xlock -mode life1d -size 1
'';
in
{
config = mkIf config.components.gui.xorg.enable {
environment.systemPackages = [
lockProgram
(pkgs.makeDesktopItem {
name = "lock";
desktopName = "lock";
exec = "${lockProgram}/bin/lock";
terminal = false;
})
];
};
}