users#nrd: init ssh

This commit is contained in:
Timothy DeHerrera 2019-12-15 02:37:45 -07:00
parent 4122c25ac0
commit 3abc7fe973
No known key found for this signature in database
GPG key ID: 8985725DB5B0C122
3 changed files with 42 additions and 0 deletions

BIN
secrets/github Normal file

Binary file not shown.

BIN
secrets/gitlab Normal file

Binary file not shown.

View file

@ -1,9 +1,14 @@
{ lib, ... }:
let
inherit (builtins)
toFile
;
inherit (lib)
fileContents
;
name = "Timothy DeHerrera";
in
{
@ -48,6 +53,43 @@ in
};
};
programs.ssh = {
enable = true;
hashKnownHosts = true;
identitiesOnly = true;
matchBlocks = let
githubKey = toFile "github"
(fileContents ../secrets/github);
gitlabKey = toFile "gitlab"
(fileContents ../secrets/gitlab);
in
{
github = {
host = "github.com";
identityFile = githubKey;
extraOptions = {
AddKeysToAgent = "yes";
};
};
gitlab = {
host = "gitlab.com";
identityFile = gitlabKey;
extraOptions = {
AddKeysToAgent = "yes";
};
};
"gitlab.company" = {
host = "gitlab.company.com";
identityFile = gitlabKey;
extraOptions = {
AddKeysToAgent = "yes";
};
};
};
};
services.gng-agent = {
enable = true;
defaultCacheTtl = 1800;