feat(home:ssh): add github to ssh knownhosts
This commit is contained in:
parent
ea5054789d
commit
f0bd3f97af
4 changed files with 16 additions and 8 deletions
|
|
@ -3,20 +3,21 @@
|
|||
let
|
||||
inherit (lib) mkIf;
|
||||
cfg = config.ooknet.tools.ssh;
|
||||
admin = osConfig.ooknet.host.admin;
|
||||
in
|
||||
|
||||
{
|
||||
config = mkIf cfg.enable {
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
extraConfig = /* config */''
|
||||
Host *
|
||||
IdentityAgent "~/.1password/agent.sock"
|
||||
'';
|
||||
compression = true;
|
||||
hashKnownHosts = true;
|
||||
matchBlocks = {
|
||||
"github.com" = {
|
||||
user = "git";
|
||||
hostname = "github.com";
|
||||
identityFile = "${osConfig.age.secrets.github_key.path}";
|
||||
};
|
||||
};
|
||||
};
|
||||
programs.fish.interactiveShellInit = mkIf (admin.shell == "fish") /* fish */ ''
|
||||
set -gx SSH_AUTH_SOCK ~/.1password/agent.sock
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,5 +20,11 @@ in
|
|||
group = "users";
|
||||
mode = "400";
|
||||
};
|
||||
github_key = mkIf admin.homeManager {
|
||||
file = "${self}/secrets/github_key.age";
|
||||
path = "/home/${admin.name}/.ssh/github_key";
|
||||
owner = "${admin.name}";
|
||||
group = "users";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
BIN
secrets/github_key.age
Normal file
BIN
secrets/github_key.age
Normal file
Binary file not shown.
|
|
@ -5,4 +5,5 @@ in
|
|||
|
||||
{
|
||||
"tailscale-auth.age".publicKeys = [ users.ooks] ++ workstations;
|
||||
"github_key.age".publicKeys = [ users.ooks ] ++ workstations;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue