refactor(networking): split networking into modules
This commit is contained in:
		
							parent
							
								
									4a177d2122
								
							
						
					
					
						commit
						221d9e3e33
					
				
					 8 changed files with 227 additions and 30 deletions
				
			
		
							
								
								
									
										21
									
								
								system/modules/networking/resolved/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								system/modules/networking/resolved/default.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,21 @@
 | 
			
		|||
{ lib, config, ... }:
 | 
			
		||||
 | 
			
		||||
let
 | 
			
		||||
  cfg = config.systemModules.networking;
 | 
			
		||||
  inherit (lib) mkIf mkEnableOption;
 | 
			
		||||
in
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  options.systemModules.networking.resolved = mkEnableOption "Enable systemd resolved daemon";
 | 
			
		||||
 | 
			
		||||
  config = mkIf cfg.resolved {
 | 
			
		||||
    services.resolved = {
 | 
			
		||||
      enable = true;
 | 
			
		||||
      fallbackDns = ["9.9.9.9"];
 | 
			
		||||
      # allow-downgrade is vulnerable to downgrade attacks
 | 
			
		||||
      extraConfig = ''
 | 
			
		||||
         DNSOverTLS=yes # or allow-downgrade
 | 
			
		||||
      '';
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue