home: ssh: use 'mkMerge'

This will make it easier to add new options (e.g: for `mosh`).
This commit is contained in:
Bruno BELANYI 2023-12-07 14:29:59 +00:00
parent 8398c4350a
commit 0b9c2309da

View file

@ -7,48 +7,52 @@ in
enable = my.mkDisableOption "ssh configuration"; enable = my.mkDisableOption "ssh configuration";
}; };
config.programs.ssh = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable (lib.mkMerge [
enable = true; {
programs.ssh = {
enable = true;
includes = [ includes = [
# Local configuration, not-versioned # Local configuration, not-versioned
"config.local" "config.local"
]; ];
matchBlocks = { matchBlocks = {
"github.com" = { "github.com" = {
hostname = "github.com"; hostname = "github.com";
identityFile = "~/.ssh/shared_rsa"; identityFile = "~/.ssh/shared_rsa";
user = "git"; user = "git";
};
"gitlab.com" = {
hostname = "gitlab.com";
identityFile = "~/.ssh/shared_rsa";
user = "git";
};
"git.sr.ht" = {
hostname = "git.sr.ht";
identityFile = "~/.ssh/shared_rsa";
user = "git";
};
"git.belanyi.fr" = {
hostname = "git.belanyi.fr";
identityFile = "~/.ssh/shared_rsa";
user = "git";
};
porthos = {
hostname = "91.121.177.163";
identityFile = "~/.ssh/shared_rsa";
user = "ambroisie";
};
};
extraConfig = ''
AddKeysToAgent yes
'';
}; };
}
"gitlab.com" = { ]);
hostname = "gitlab.com";
identityFile = "~/.ssh/shared_rsa";
user = "git";
};
"git.sr.ht" = {
hostname = "git.sr.ht";
identityFile = "~/.ssh/shared_rsa";
user = "git";
};
"git.belanyi.fr" = {
hostname = "git.belanyi.fr";
identityFile = "~/.ssh/shared_rsa";
user = "git";
};
porthos = {
hostname = "91.121.177.163";
identityFile = "~/.ssh/shared_rsa";
user = "ambroisie";
};
};
extraConfig = ''
AddKeysToAgent yes
'';
};
} }