1{
2 config,
3 lib,
4 pkgs,
5 ...
6}:
7
8let
9 cfg = config.programs.yubikey-manager;
10in
11{
12 options = {
13 programs.yubikey-manager = {
14 enable = lib.mkEnableOption "yubikey-manager";
15
16 package = lib.mkPackageOption pkgs "yubikey-manager" { };
17 };
18 };
19
20 config = lib.mkIf cfg.enable {
21 environment.systemPackages = [ cfg.package ];
22
23 services = {
24 pcscd.enable = true;
25
26 # The udev rules we want aren't included in the yubikey-manager package, but
27 # we can get them from yubikey-personalization.
28 udev.packages = [ pkgs.yubikey-personalization ];
29 };
30 };
31}