nixos/home-modules/ssh-client.nix
jmug e666d4a1e1 replace forgejo user with git
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-07-11 01:01:46 -07:00

55 lines
1.5 KiB
Nix

{ lib, config, ... } : {
options.ssh-client = {
add-alarm = lib.mkEnableOption "add the alarm match block";
};
config.services.ssh-agent.enable = true;
config.programs.ssh = {
enable = true;
addKeysToAgent = "yes";
matchBlocks = {
"git" = {
host = "github.com";
user = "git";
identityFile = [
"/home/jmug/.ssh/id_yubikey" # Auto updated symlik that matches all yubikeys.
"/home/jmug/.ssh/id_jmug" # Fallback key with passphrase.
];
};
"forgejo" = {
host = "code.jmug.me";
user = "git";
identityFile = [
"/home/jmug/.ssh/id_yubikey" # Auto updated symlik that matches all yubikeys.
"/home/jmug/.ssh/id_jmug" # Fallback key with passphrase.
];
};
wsl = {
user = "jmug";
hostname = "192.168.10.241";
port = 69;
forwardAgent = true;
identityFile = [
"/home/jmug/.ssh/id_yubikey" # Auto updated symlik that matches all yubikeys.
];
};
ws = {
user = "jmug";
hostname = "98.59.213.212";
port = 69;
forwardAgent = true;
identityFile = [
"/home/jmug/.ssh/id_yubikey" # Auto updated symlik that matches all yubikeys.
];
};
} // lib.optionalAttrs config.ssh-client.add-alarm {
alarm = {
user = "alarm";
hostname = "alarm";
forwardAgent = true;
identityFile = "/home/jmug/.ssh/id_ed25519";
};
};
};
}