Enable U2F on linux systems
This commit is contained in:
parent
8e37bc2a7e
commit
3c4414fcb3
29
modules/personal/u2f.nix
Normal file
29
modules/personal/u2f.nix
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.personal.u2f;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.personal.u2f = {
|
||||||
|
enable = mkEnableOption "Enable personal U2F login modules and stuff";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
pam_u2f # for pamu2fcfg
|
||||||
|
];
|
||||||
|
security.pam = mkIf (strings.hasSuffix "linux" pkgs.system) {
|
||||||
|
u2f = {
|
||||||
|
enable = true;
|
||||||
|
cue = true;
|
||||||
|
interactive = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Services
|
||||||
|
services.sudo.u2fAuth = true;
|
||||||
|
services.login.u2fAuth = true;
|
||||||
|
services.swaylock.u2fAuth = mkIf (config.services.swaylock.enable) true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -17,6 +17,7 @@
|
||||||
../modules/services/edns
|
../modules/services/edns
|
||||||
# Other services
|
# Other services
|
||||||
../modules/services/swaylock.nix
|
../modules/services/swaylock.nix
|
||||||
|
../modules/personal/u2f.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Set kernel version to latest
|
# Set kernel version to latest
|
||||||
|
@ -216,6 +217,7 @@
|
||||||
security.pam.services.lightdm.enableKwallet = true;
|
security.pam.services.lightdm.enableKwallet = true;
|
||||||
security.pam.services.lightdm.enableGnomeKeyring = true;
|
security.pam.services.lightdm.enableGnomeKeyring = true;
|
||||||
services.swaylock.enable = true;
|
services.swaylock.enable = true;
|
||||||
|
personal.u2f.enable = true;
|
||||||
|
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
# This value determines the NixOS release from which the default
|
||||||
|
|
Loading…
Reference in a new issue