forked from jan-leila/nix-config
		
	feat: added block list to crab-hole
This commit is contained in:
		
							parent
							
								
									d19d535d85
								
							
						
					
					
						commit
						290c0692bb
					
				
					 2 changed files with 22 additions and 0 deletions
				
			
		|  | @ -89,6 +89,23 @@ in { | |||
|       default = []; | ||||
|       description = "List of additional upstream DNS server configurations."; | ||||
|     }; | ||||
| 
 | ||||
|     blocklists = { | ||||
|       ad_malware = { | ||||
|         enable = lib.mkEnableOption "Host file for blocking ads and malware"; | ||||
|         url = lib.mkOption { | ||||
|           type = lib.types.str; | ||||
|           default = "http://sbc.io/hosts/hosts"; | ||||
|           description = "URL of the ad and malware blocklist host file"; | ||||
|         }; | ||||
|       }; | ||||
|     }; | ||||
| 
 | ||||
|     extraBlocklists = lib.mkOption { | ||||
|       type = lib.types.listOf lib.types.str; | ||||
|       default = []; | ||||
|       description = "Additional blocklist URLs to be added to the configuration"; | ||||
|     }; | ||||
|   }; | ||||
| 
 | ||||
|   config = lib.mkIf cfg.enable { | ||||
|  | @ -119,7 +136,11 @@ in { | |||
|         }; | ||||
|         downstream = cfg.extraDownstreams; | ||||
|         upstream.name_servers = cfg.extraUpstreams; | ||||
|         blocklist.lists = cfg.extraBlocklists; | ||||
|       } | ||||
|       (lib.mkIf cfg.blocklists.ad_malware.enable { | ||||
|         blocklist.lists = [cfg.blocklists.ad_malware.url]; | ||||
|       }) | ||||
|       (lib.mkIf cfg.downstreams.host.enable { | ||||
|         downstream = [ | ||||
|           { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue