1 { config, lib, pkgs, ... }:
7 cfg = config.programs.i3lock;
15 enable = mkEnableOption (mdDoc "i3lock");
18 default = pkgs.i3lock;
19 defaultText = literalExpression "pkgs.i3lock";
20 example = literalExpression ''
23 description = mdDoc ''
24 Specify which package to use for the i3lock program,
25 The i3lock package must include a i3lock file or link in its out directory in order for the u2fSupport option to work correctly.
28 u2fSupport = mkOption {
32 description = mdDoc ''
33 Whether to enable U2F support in the i3lock program.
34 U2F enables authentication using a hardware device, such as a security key.
35 When U2F support is enabled, the i3lock program will set the setuid bit on the i3lock binary and enable the pam u2fAuth service,
43 config = mkIf cfg.enable {
45 environment.systemPackages = [ cfg.package ];
47 security.wrappers.i3lock = mkIf cfg.u2fSupport {
51 source = "${cfg.package.out}/bin/i3lock";
54 security.pam.services.i3lock.u2fAuth = cfg.u2fSupport;