yubikey.nix 911 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. { lib, pkgs, ... }:
  2. with lib;
  3. let
  4. inherit (pkgs.stdenv.hostPlatform) isLinux;
  5. in
  6. {
  7. programs.gpg = {
  8. settings = {
  9. no-comments = true;
  10. no-emit-version = true;
  11. no-symkey-cache = true;
  12. default-new-key-algo = "ed25519/cert,sign+cv25519/encr";
  13. personal-cipher-preferences = "AES256 CAMELLIA256 AES192 CAMELLIA192 AES CAMELLIA128";
  14. personal-compress-preferences = "ZLIB BZIP2 ZIP Uncompressed";
  15. personal-digest-preferences = "SHA512 SHA384 SHA256";
  16. pinentry-mode = "loopback";
  17. };
  18. scdaemonSettings = {
  19. reader-port = "Yubico Yubi";
  20. disable-ccid = true;
  21. };
  22. };
  23. services.gpg-agent = mkIf isLinux {
  24. enable = mkDefault true;
  25. enableBashIntegration = true;
  26. enableFishIntegration = true;
  27. enableSshSupport = true;
  28. pinentryFlavor = "curses";
  29. sshKeys = [
  30. "0C8022799396573FE31D595B2C4B60B871618D9C"
  31. ];
  32. };
  33. }