Files
dotfiles/home-modules/ssh.nix
Lennart J. Kurzweg (Nx2) 858a8b77ec tuda rust labs
2025-10-21 15:22:55 +02:00

39 lines
1.1 KiB
Nix

{ pkgs, ... }@all: with all; {
home.packages = with pkgs; [ sshfs ];
programs.ssh = {
enable = true;
package = pkgs.openssh;
addKeysToAgent = "yes";
matchBlocks = let
nxace = name: {
host = name;
hostname = "ssh.${hyper.domain}";
user = hyper.user;
port = 50022;
identityFile = "${hyper.home}/vault/ssh/nxace-nx2-${hyper.host}";
};
in {
"*" = {
identityFile = [
"${hyper.home}/vault/ssh/nxgit-nx2-${hyper.host}"
"${hyper.home}/vault/ssh/github-noggynoggy-${hyper.host}"
"${hyper.home}/vault/ssh/tg-dm-informatik-tuda"
];
};
"nxace" = nxace "nxace";
"nxacel" = (nxace "nxacel") // { hostname = "10.0.1.1"; };
"nxrpli" = (nxace "nxrpil") // { hostname = "10.0.1.31"; port = 22; };
"nxgit" = (nxace "nxgit") // {
user = "git";
identityFile = "${hyper.home}/vault/ssh/nxgit-nx2-${hyper.host}";
# addKeysToAgent = "1h";
};
};
};
services.ssh-agent = {
enable = true;
# socket = "ssh-agent"; # suffix to $XDG_RUNTIME_DIR
# package = pkgs.openssh;
};
}