mirror of
https://github.com/Jokiller230/puzzlevision.git
synced 2025-01-18 09:53:06 +01:00
feat: update yubikey configuration
This commit is contained in:
parent
d06c14e32d
commit
27829eb0fc
1 changed files with 14 additions and 2 deletions
|
@ -7,7 +7,7 @@
|
||||||
}: with lib; with lib.${namespace};
|
}: with lib; with lib.${namespace};
|
||||||
let
|
let
|
||||||
cfg = config.${namespace}.security.yubikey;
|
cfg = config.${namespace}.security.yubikey;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.${namespace}.security.yubikey = with types; {
|
options.${namespace}.security.yubikey = with types; {
|
||||||
enable = mkEnableOption "Enable the Yubikey as a security device.";
|
enable = mkEnableOption "Enable the Yubikey as a security device.";
|
||||||
|
@ -17,6 +17,7 @@ in
|
||||||
example = [ "123456" "1234567" ];
|
example = [ "123456" "1234567" ];
|
||||||
description = "Register additional Yubikey IDs.";
|
description = "Register additional Yubikey IDs.";
|
||||||
};
|
};
|
||||||
|
enable-agent = mkEnableOption "Enable the Yubikey agent";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
@ -34,5 +35,16 @@ in
|
||||||
login.u2fAuth = true;
|
login.u2fAuth = true;
|
||||||
sudo.u2fAuth = true;
|
sudo.u2fAuth = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.yubikey-agent.enable = cfg.enable-agent;
|
||||||
|
|
||||||
|
programs.ssh.extraConfig = mkIf cfg.enable-agent ''
|
||||||
|
Host *
|
||||||
|
IdentityAgent /usr/local/var/run/yubikey-agent.sock
|
||||||
|
'';
|
||||||
|
|
||||||
|
environment.sessionVariables = mkIf cfg.enable-agent {
|
||||||
|
SSH_AUTH_SOCK = "/usr/local/var/run/yubikey-agent.sock";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue