blob: cd39f5dd34cc905fa9f30793337b5c853b5cab1c [file] [log] [blame]
Skyler Grey63904432024-02-20 23:25:45 +00001{ config, lib, ... }: {
2 options = {
3 chimera.yubikey.enable = lib.mkEnableOption "Enable support for YuibKeys";
PineaFan8af65a72024-04-20 21:00:21 +01004 chimera.yubikey.pam.enable = lib.mkEnableOption "Enable Login and sudo via YubiKey";
5 chimera.yubikey.pam.key = lib.mkOption {
6 type = lib.types.str;
7 example = "<username>:<KeyHandle1>,<UserKey1>,<CoseType1>,<Options1>:<KeyHandle2>,<UserKey2>,<CoseType2>,<Options2>:...";
8 description = "A string following the example";
9 };
10 };
11
12 config = lib.mkIf (config.chimera.yubikey.pam.enable && config.chimera.yubikey.enable) {
13 home.file.".config/Yubico/u2f_keys" = {
14 target = ".config/Yubico/u2f_keys";
15 enable = true;
16 text = config.chimera.yubikey.pam.key;
17 };
Skyler Grey63904432024-02-20 23:25:45 +000018 };
19}