dotfiles/modules/nixos/apps/yubikey/default.nix

37 lines
700 B
Nix
Raw Permalink Normal View History

{
config,
pkgs,
lib,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.aa.apps.yubikey;
in {
options.aa.apps.yubikey = {
enable = mkEnableOption "yubikey";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
yubikey-manager
yubikey-agent
yubico-pam
2023-07-09 15:24:54 +00:00
age-plugin-yubikey
rage
];
services.pcscd.enable = true;
security.pam.yubico = {
enable = true;
mode = "challenge-response";
# Uncomment below for 2FA
#control = "required";
};
# To set up, need to run (might need to run first command as root)
# ykman otp chalresp --touch --generate 2
# ykpamcfg -2 -v
};
}