From 94d28215a6633b86b5ffc8756bda3f76554e749a Mon Sep 17 00:00:00 2001 From: Eclypsed Date: Thu, 23 Oct 2025 23:52:24 -0400 Subject: [PATCH] Begun yubikey integration --- modules/home/default.nix | 1 + modules/home/packages.nix | 1 - modules/home/ssh.nix | 30 ++++++++++++++++++++++++++++++ modules/home/zsh.nix | 4 ++-- modules/system/security.nix | 11 ++++++++++- modules/system/user.nix | 2 ++ 6 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 modules/home/ssh.nix diff --git a/modules/home/default.nix b/modules/home/default.nix index 29e3ae5..cbe5ace 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -9,6 +9,7 @@ ./nvf.nix ./packages.nix ./plasma.nix + ./ssh.nix ./stylix.nix ./vscode.nix ./zsh.nix diff --git a/modules/home/packages.nix b/modules/home/packages.nix index ff7f8e3..9024c90 100644 --- a/modules/home/packages.nix +++ b/modules/home/packages.nix @@ -9,7 +9,6 @@ discord sqlitebrowser drawio - bitwarden-desktop # Libre Office libreoffice-qt diff --git a/modules/home/ssh.nix b/modules/home/ssh.nix new file mode 100644 index 0000000..21a959e --- /dev/null +++ b/modules/home/ssh.nix @@ -0,0 +1,30 @@ +{ + ... +}: +{ + programs.ssh = { + enable = true; + enableDefaultConfig = false; + matchBlocks = { + "*" = { + addKeysToAgent = "yes"; + identityFile = [ "~/.ssh/id_ed25519_sk_rk" ]; + }; + "stu" = { + hostname = "stu.cs.jmu.edu"; + user = "tamassno"; + localForwards = [ + { + bind.port = 5432; + host = { + address = "data.cs.jmu.edu"; + port = 5432; + }; + } + ]; + serverAliveCountMax = 5; + serverAliveInterval = 60; + }; + }; + }; +} diff --git a/modules/home/zsh.nix b/modules/home/zsh.nix index 8c77e65..3bf9057 100644 --- a/modules/home/zsh.nix +++ b/modules/home/zsh.nix @@ -79,8 +79,8 @@ enableCompletion = true; autosuggestion.enable = true; syntaxHighlighting.enable = true; - sessionVariables = { - SSH_AUTH_SOCK = "/home/eclypse/.bitwarden-ssh-agent.sock"; + shellAliases = { + stu = "ssh tamassno@stu.cs.jmu.edu"; }; }; }; diff --git a/modules/system/security.nix b/modules/system/security.nix index 638fe3f..77c9b56 100644 --- a/modules/system/security.nix +++ b/modules/system/security.nix @@ -2,7 +2,16 @@ ... }: { + programs = { + yubikey-manager.enable = true; + yubikey-touch-detector.enable = true; + }; + + services = { + yubikey-agent.enable = true; + }; + security = { rtkit.enable = true; }; -} \ No newline at end of file +} diff --git a/modules/system/user.nix b/modules/system/user.nix index ad9cf0e..daa26d8 100644 --- a/modules/system/user.nix +++ b/modules/system/user.nix @@ -22,6 +22,8 @@ }; programs.home-manager.enable = true; }; + + backupFileExtension = "backup"; }; users.mutableUsers = false;