programs.swaylock.enable

Whether to enable swaylock.

Note that PAM must be configured to enable swaylock to perform authentication. The package installed through home-manager will not be able to unlock the session without this configuration.

On NixOS, this is by default enabled with the sway module, but for other compositors it can currently be enabled using:

security.pam.services.swaylock = {};

On non-NixOS, it is easiest to avoid incompatibility involving PAM by

  1. stopping Home Manager from installing swaylock by setting programs.swaylock.package to null; and

  2. instead installing swaylock from your distribution's repository.

Type
boolean
Default
true  if state version < 23.05 and settings ≠ { },
false otherwise
Example
true
Declared
<home-manager/modules/programs/swaylock.nix>