nixpkgs/home/programs/ssh.nix
Daniel Siepmann 1339777798
Enable UpdateHostKeys for ssh
This fetches all new host keys when connecting to an existing host.
This allows to fetch newer keys and prevents a question if old keys no
longer exist.
2023-03-15 11:03:54 +01:00

27 lines
387 B
Nix

_:
let
oldKey = "~/.ssh/id_rsa";
newKey = "~/.ssh/id_ed25519";
in {
enable = true;
matchBlocks = {
"*" = {
extraOptions = {
UpdateHostKeys = "yes";
};
};
"github.com" = {
user = "git";
hostname = "github.com";
identityFile = "${newKey}";
};
} // import ./ssh-match-blocks.nix {
inherit oldKey newKey;
};
}