Something went wrong. Try again.
Something went wrong. Try again.
2.2 kB · 79 lines
Nix
at main
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980{ inputs, ... }:{ flake.modules.homeManager.ssh = { pkgs, lib, ... }: let # Identity files used for the homelab box (admin login and knot pushes). homelabKeys = [ "~/.ssh/id_ed25519" "~/.ssh/id_ed25519_sk" "~/.ssh/id_ecdsa_sk" ];
homelabLanIp = "192.168.1.126"; in { home.packages = with pkgs; [ yubikey-personalization yubikey-manager ];
programs.ssh = { enable = true; enableDefaultConfig = false;
settings = { "*" = { IdentityFile = [ "~/.ssh/id_ed25519" ]; }; "ssh.dev.azure.com" = { User = "git"; HostName = "ssh.dev.azure.com"; IdentityFile = [ "~/.ssh/id_rsa" ]; IdentitiesOnly = true; }; "github.com" = { User = "git"; HostName = "github.com"; IdentitiesOnly = true; IdentityFile = [ "~/.ssh/id_ed25519" ]; ControlMaster = "auto"; ControlPath = "~/.ssh/S.%r@%h:%p"; ControlPersist = "60m"; ServerAliveInterval = 15; ServerAliveCountMax = 3; }; "synology" = { SetEnv = { TERM = "xterm-256color"; }; HostName = "disketten.local"; User = "idealpink"; Port = 1337; IdentitiesOnly = true; IdentityFile = [ "~/.ssh/id_ed25519_sk" "~/.ssh/id_ecdsa_sk" ]; }; "homelab" = { HostName = homelabLanIp; User = "idealpink"; Port = 22; IdentitiesOnly = true; IdentityFile = homelabKeys; }; # Tangled knot. The git user is no-pty, so Ghostty's ssh-terminfo # install hangs/fails on every connect. Prime the cache to skip it: # ghostty +ssh-cache --add=git@knot.ankarhem.dev "knot.ankarhem.dev" = { # HostName = homelabLanIp; User = "git"; Port = 22; IdentitiesOnly = true; IdentityFile = homelabKeys; }; }; }; };}