home: ssh: use 'mkMerge'
This will make it easier to add new options (e.g: for `mosh`).
This commit is contained in:
parent
8398c4350a
commit
0b9c2309da
|
@ -7,48 +7,52 @@ in
|
|||
enable = my.mkDisableOption "ssh configuration";
|
||||
};
|
||||
|
||||
config.programs.ssh = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||
{
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
|
||||
includes = [
|
||||
# Local configuration, not-versioned
|
||||
"config.local"
|
||||
];
|
||||
includes = [
|
||||
# Local configuration, not-versioned
|
||||
"config.local"
|
||||
];
|
||||
|
||||
matchBlocks = {
|
||||
"github.com" = {
|
||||
hostname = "github.com";
|
||||
identityFile = "~/.ssh/shared_rsa";
|
||||
user = "git";
|
||||
matchBlocks = {
|
||||
"github.com" = {
|
||||
hostname = "github.com";
|
||||
identityFile = "~/.ssh/shared_rsa";
|
||||
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
|
||||
'';
|
||||
};
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue