Skip to content

Commit

Permalink
yubikey cool
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelroses committed Nov 3, 2023
1 parent 0282e17 commit 131692f
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 2 deletions.
1 change: 1 addition & 0 deletions hosts/amatarasu/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ in {
sound.enable = true;
bluetooth.enable = false;
printing.enable = false;
yubikeySupport.enable = true;

security = {
auditd.enable = true;
Expand Down
3 changes: 2 additions & 1 deletion hosts/hydra/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ _: {
type = "laptop";
cpu = "intel";
gpu = null;
monitors = ["HDMI-A-1" "eDP-1"];
monitors = ["eDP-1"];
hasTPM = true;
hasBluetooth = true;
hasSound = true;
Expand All @@ -28,6 +28,7 @@ _: {
sound.enable = true;
bluetooth.enable = true;
printing.enable = false;
yubikeySupport.enable = true;

security = {
fixWebcam = false;
Expand Down
1 change: 0 additions & 1 deletion modules/base/common/host/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ _: {
./emulation # emulation setup
./encryption # keeping my stuff hidden from you strange people
./hardware # hardware - bluetooth etc.
./media # sound and video
./nix # nix the package manger options
./os # system configurations
./security # keeping the system safe
Expand Down
2 changes: 2 additions & 0 deletions modules/base/common/host/hardware/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ _: {
./cpu # cpu specific options
./gpu # gpu specific options
./tmp # Trusted Platform Module
./media # sound and video
./bluetooth # bluetooth
./yubikey # yubikey device support and management tools
];
}
File renamed without changes.
33 changes: 33 additions & 0 deletions modules/base/common/host/hardware/yubikey/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
config,
lib,
pkgs,
...
}: {
config = lib.mkIf config.modules.system.yubikeySupport.enable {
hardware.gpgSmartcards.enable = true;

services = {
pcscd.enable = true;
udev.packages = [pkgs.yubikey-personalization];
};

programs = {
ssh.startAgent = false;
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
};

environment.systemPackages = with pkgs; [
# Yubico's official tools
yubikey-manager # cli
yubikey-manager-qt # gui
yubikey-personalization # cli
yubikey-personalization-gui # gui
yubico-piv-tool # cli
yubioath-flutter # gui
];
};
}
9 changes: 9 additions & 0 deletions modules/base/options/system/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ in {
description = "The path to the configuration";
};

yubikeySupport = {
enable = mkEnableOption "yubikey support";
deviceType = mkOption {
type = with types; nullOr enum ["NFC5" "nano"];
default = null;
description = "A list of devices to enable Yubikey support for";
};
};

sound = {
enable = mkEnableOption "sound";
description = "Does the device have sound and its related programs be enabled";
Expand Down

0 comments on commit 131692f

Please sign in to comment.