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 | let | ||||||
|   inherit (lib) mkIf; |   inherit (lib) mkIf; | ||||||
|   cfg = config.ooknet.tools.ssh; |   cfg = config.ooknet.tools.ssh; | ||||||
|   admin = osConfig.ooknet.host.admin; |  | ||||||
| in | in | ||||||
| 
 | 
 | ||||||
| { | { | ||||||
|   config = mkIf cfg.enable { |   config = mkIf cfg.enable { | ||||||
|     programs.ssh = { |     programs.ssh = { | ||||||
|       enable = true; |       enable = true; | ||||||
|       extraConfig = /* config */'' |       compression = true; | ||||||
|         Host * |       hashKnownHosts = true; | ||||||
|             IdentityAgent "~/.1password/agent.sock" |       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"; |       group = "users"; | ||||||
|       mode = "400"; |       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; |   "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