ssh agent proper setup

This commit is contained in:
Nathan McCarty 2025-03-27 14:58:38 -04:00
parent 95feab33ad
commit 582602fe82
3 changed files with 25 additions and 5 deletions

View file

@ -32,6 +32,7 @@
../../modules/programs/core.nix
../../modules/programs/devel.nix
../../modules/programs/ssh.nix
../../modules/programs/ssh-agent.nix
(import ../../modules/programs/emacs.nix {})
../../modules/programs/fonts.nix
../../modules/programs/desktop.nix

View file

@ -0,0 +1,17 @@
{
config,
lib,
pkgs,
...
}: {
# Enable the agent
services.ssh-agent = {
enable = true;
};
# Setup fish init
programs.fish.shellInit =
''
set -x SSH_AUTH_SOCK $XDG_RUNTIME_DIR/ssh-agent
ssh-add
'';
}

View file

@ -4,9 +4,6 @@
pkgs,
...
}: {
services.ssh-agent = {
enable = true;
};
programs.ssh = {
# SSH configuration
enable = true;
@ -19,10 +16,14 @@
# enable session reuse
controlMaster = "auto";
controlPersist = "10m";
# setup agent
addKeysToAgent = "yes";
# Configure known hosts
matchBlocks = {
# rsync.net
"de1955" = {
hostname = "de1955.rsync.net";
user = "de1955";
};
# my nixos machines
"tides" = {
hostname = "150.136.87.190";
forwardAgent = true;
@ -31,6 +32,7 @@
hostname = "driftwood.stranger.systems";
forwardAgent = true;
};
# Other Machines
"static.stranger.systems" = {
hostname = "129.153.226.221";
user = "ubuntu";