Skip to content

Commit

Permalink
nixos: Make yubikey work on boot
Browse files Browse the repository at this point in the history
  • Loading branch information
TLATER committed Jan 28, 2024
1 parent a5f06d4 commit a884471
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
4 changes: 1 addition & 3 deletions nixos-config/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
./greeter
./sway.nix
./wireguard.nix
./yubikey.nix
../modules
];

Expand Down Expand Up @@ -239,12 +240,9 @@
pulse.enable = true;
};

udev.packages = [pkgs.yubikey-personalization];

nscd.enableNsncd = true;
blueman.enable = true;
chrony.enable = true;
pcscd.enable = true;
flatpak.enable = true;
fstrim.enable = true;
fwupd.enable = true;
Expand Down
19 changes: 19 additions & 0 deletions nixos-config/yubikey.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{pkgs, ...}: {
services = {
udev.packages = [pkgs.yubikey-personalization];
pcscd.enable = true;
};

hardware.gpgSmartcards.enable = true;

# sops-nix will launch an scdaemon instance on boot, which will stay
# alive and prevent the yubikey from working with any users that log
# in later.
systemd.services.shutdownSopsGpg = {
path = [pkgs.gnupg];
script = ''
gpgconf --homedir /var/lib/sops --kill gpg-agent
'';
wantedBy = ["multi-user.target"];
};
}

0 comments on commit a884471

Please sign in to comment.