dotfiles.nix/nixos/common/optional/key.nix

24 lines
566 B
Nix
Raw Normal View History

2024-01-21 21:03:57 +08:00
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
# Enables files to be encrypted to age identities stored on YubiKeys
age-plugin-yubikey
2024-04-14 21:57:21 +08:00
# Cryptfile
cryptsetup
# Yubikey can be used as a smart card for secure encryption
gnupg
# Configure your YubiKey via the command line
yubikey-manager
2024-01-21 21:03:57 +08:00
];
# Use our yubikey as a user login or for sudo access
security.pam.services = {
login.u2fAuth = true;
sudo.u2fAuth = true;
};
2024-04-14 21:57:21 +08:00
# Enable udev rules for gnupg smart cards
hardware.gpgSmartcards.enable = true;
2024-01-21 21:03:57 +08:00
}