Skyler Grey | 6390443 | 2024-02-20 23:25:45 +0000 | [diff] [blame] | 1 | { config, lib, ... }: { |
| 2 | options = { |
| 3 | chimera.yubikey.enable = lib.mkEnableOption "Enable support for YuibKeys"; |
PineaFan | 8af65a7 | 2024-04-20 21:00:21 +0100 | [diff] [blame] | 4 | 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 Grey | 6390443 | 2024-02-20 23:25:45 +0000 | [diff] [blame] | 18 | }; |
| 19 | } |