Made yubikey config reusable

This commit is contained in:
Alejandro Angulo 2022-09-22 20:21:12 -07:00
parent ee956f735e
commit 2811bd995f
4 changed files with 30 additions and 17 deletions

24
common/yubikey.nix Normal file
View file

@ -0,0 +1,24 @@
{
config,
pkgs,
...
}: {
environment.systemPackages = with pkgs; [
yubikey-manager
yubikey-agent
yubico-pam
];
services.pcscd.enable = true;
security.pam.yubico = {
enable = true;
#debug = true;
mode = "challenge-response";
# Uncomment below for 2FA
#control = "required";
};
# To set up, need to run (might need to run as root)
# ykman otp chalresp --touch --generate 2
# ykpamcfg -2 -v
}

View file

@ -51,6 +51,7 @@
modules = [ modules = [
./system/carbon/configuration.nix ./system/carbon/configuration.nix
./common/yubikey.nix
]; ];
}; };
@ -59,6 +60,7 @@
modules = [ modules = [
./system/gospel/configuration.nix ./system/gospel/configuration.nix
./common/yubikey.nix
]; ];
}; };
}; };

View file

@ -109,10 +109,6 @@
wireguard-tools wireguard-tools
prusa-slicer prusa-slicer
yubikey-manager
yubikey-agent
yubico-pam
]; ];
# Some programs need SUID wrappers, can be configured further or are # Some programs need SUID wrappers, can be configured further or are
@ -165,19 +161,6 @@
pulse.enable = true; pulse.enable = true;
}; };
services.pcscd.enable = true;
security.pam.yubico = {
enable = true;
#debug = true;
mode = "challenge-response";
# Uncomment below for 2FA
#control = "required";
};
# To set up, need to run (might need to run as root)
# ykman otp chalresp --touch --generate 2
# ykpamcfg -2 -v
# Open ports in the firewall. # Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ];

View file

@ -10,6 +10,10 @@
programs.gpg = { programs.gpg = {
enable = true; enable = true;
scdaemonSettings = {
# Fix conflicts with config in common/yubikey.nix
disable-ccid = true;
};
}; };
services.gpg-agent = { services.gpg-agent = {