You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nixos-template-base/services/yubikey.nix

43 lines
944 B
Nix

{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.fqdn}";
flags = currentMachine.configurationFlags;
in
mkIf true {
# Services
# https://github.com/NixOS/nixpkgs/issues/15960
services = {
pcscd.enable = true;
udev.packages = with pkgs; [
libu2f-host
yubikey-personalization
];
xserver.displayManager.sessionCommands = ''
# https://github.com/NixOS/nixpkgs/commit/5391882ebd781149e213e8817fba6ac3c503740c
gpg-connect-agent /bye
GPG_TTY=$(tty)
export GPG_TTY
'';
};
users.extraGroups.yubikey = {};
environment.systemPackages = with pkgs; [
gnupg opensc pcsctools libu2f-host yubikey-personalization
];
security.pam.u2f.enable = true;
/*users.extraUsers.joko = {
isNormalUser = true;
extraGroups = [ "wheel" "input" "audio" "video" ];
};*/
}