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
				
			
		|  | @ -354,6 +354,7 @@ | ||||||
|         }; |         }; | ||||||
|       }; |       }; | ||||||
|       upstreams.cloudFlare.enable = true; |       upstreams.cloudFlare.enable = true; | ||||||
|  |       blocklists.ad_malware.enable = true; | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     qbittorrent = { |     qbittorrent = { | ||||||
|  |  | ||||||
|  | @ -89,6 +89,23 @@ in { | ||||||
|       default = []; |       default = []; | ||||||
|       description = "List of additional upstream DNS server configurations."; |       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 { |   config = lib.mkIf cfg.enable { | ||||||
|  | @ -119,7 +136,11 @@ in { | ||||||
|         }; |         }; | ||||||
|         downstream = cfg.extraDownstreams; |         downstream = cfg.extraDownstreams; | ||||||
|         upstream.name_servers = cfg.extraUpstreams; |         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 { |       (lib.mkIf cfg.downstreams.host.enable { | ||||||
|         downstream = [ |         downstream = [ | ||||||
|           { |           { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue