Files
nixos-template-base/services/yubikey.nix

43 lines
944 B
Nix
Raw Normal View History

2017-05-15 22:53:29 +02:00
{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.fqdn}";
flags = currentMachine.configurationFlags;
2017-05-15 22:53:29 +02:00
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;
2017-05-15 22:53:29 +02:00
/*users.extraUsers.joko = {
isNormalUser = true;
extraGroups = [ "wheel" "input" "audio" "video" ];
};*/
}