Add SSH to home-manager

This commit is contained in:
Artemis Tosini 2021-08-27 23:11:59 +00:00
parent f249dd5fc7
commit 99a2935bc7
Signed by: artemist
GPG key ID: ADFFE553DCBB831E
3 changed files with 29 additions and 3 deletions

View file

@ -14,6 +14,7 @@
./mpv.nix
./kitty.nix
./neovim
./ssh.nix
];
services.syncthing.enable = true;

View file

@ -1,10 +1,35 @@
{ config, pkgs, ... }:
{
# Make sure controlPath directory exists
home.file.".ssh/c/.dummy".text = "";
programs.ssh = {
enable = true;
controlMaster = "auto";
controlPersist = "1h";
controlPath = "~/.ssh/sockets/%r@%n:%p";
controlPersist = "10m";
controlPath = "~/.ssh/c/%r@%n:%p";
hashKnownHosts = true;
# We have to do this as text to gaurantee it's part of the last Host * block
extraConfig = ''
HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ssh-rsa,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
VerifyHostKeyDNS ask
VisualHostKey yes
UpdateHostKeys ask
'';
# Most hosts are set in private
matchBlocks = {
"*.cmu.edu" = {
user = "atosini";
extraOptions = {
GSSAPIAuthentication = "yes";
GSSAPIDelegateCredentials = "yes";
};
};
"github.com".extraOptions.ControlMaster = "no";
};
};
}

@ -1 +1 @@
Subproject commit 2d2356dc284d8cbee99f7835a7e52b9e325747ed
Subproject commit 3512e177ea84eccde10e92f2f59f9ca53fd12be3