refactor(networking): split networking into modules
This commit is contained in:
		
							parent
							
								
									4a177d2122
								
							
						
					
					
						commit
						221d9e3e33
					
				
					 8 changed files with 227 additions and 30 deletions
				
			
		
							
								
								
									
										27
									
								
								system/modules/networking/ssh/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								system/modules/networking/ssh/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,27 @@ | |||
| { lib, config, ... }: | ||||
| 
 | ||||
| let | ||||
|   cfg = config.systemModules.networking; | ||||
|   key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBn3ff3HaZHIyH4K13k8Mwqu/o7jIABJ8rANK+r2PfJk"; | ||||
|   inherit (lib) mkIf mkEnableOption; | ||||
| in | ||||
| 
 | ||||
| { | ||||
|   options.systemModules.networking.ssh = mkEnableOption "Enable ssh networking module"; | ||||
| 
 | ||||
|   config = mkIf cfg.ssh { | ||||
|     environment.sessionVariables.SSH_AUTH_SOCK = "~/.1password/agent.sock"; | ||||
| 
 | ||||
|     users.users.ooks.openssh.authorizedKeys.keys = [ key ]; | ||||
| 
 | ||||
|     services.openssh = { | ||||
|       enable = true; | ||||
|       settings = { | ||||
|         UseDns = true; | ||||
|         PasswordAuthentication = false; | ||||
|         PermitRootLogin = "no"; | ||||
|         StreamLocalBindUnlink = "yes"; | ||||
|       }; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue