{ config, lib, pkgs, ... }: let socket = "${config.home.homeDirectory}/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh"; in { home.sessionVariables.SSH_AUTH_SOCK = socket; programs.ssh = { enable = true; matchBlocks = { # use the keychain on macOS "*".extraOptions = lib.mkIf pkgs.stdenv.isDarwin { UseKeychain = "yes"; AddKeysToAgent = "yes"; IdentityAgent = socket; }; # entry for easy access to reMarkable tablet remarkable = { hostname = "10.11.99.1"; user = "root"; }; }; }; }