diff --git a/modules/home/ssh/default.nix b/modules/home/ssh/default.nix index 123190f..b5bdf76 100644 --- a/modules/home/ssh/default.nix +++ b/modules/home/ssh/default.nix @@ -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 - ''; - }; + } + ]); }