Daniel Siepmann
1339777798
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.
27 lines
387 B
Nix
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;
|
|
};
|
|
}
|