forked from jan-leila/nix-config
		
	refactor: split server modules into smaller more manageable files
This commit is contained in:
		
							parent
							
								
									b2e5ae1f98
								
							
						
					
					
						commit
						cdeb4e108b
					
				
					 49 changed files with 1519 additions and 1270 deletions
				
			
		
							
								
								
									
										71
									
								
								modules/nixos-modules/server/searx/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										71
									
								
								modules/nixos-modules/server/searx/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,71 @@ | |||
| { | ||||
|   config, | ||||
|   lib, | ||||
|   inputs, | ||||
|   ... | ||||
| }: { | ||||
|   imports = [ | ||||
|     ./proxy.nix | ||||
|   ]; | ||||
| 
 | ||||
|   options.services.searx = { | ||||
|     subdomain = lib.mkOption { | ||||
|       type = lib.types.str; | ||||
|       description = "subdomain of base domain that searx will be hosted at"; | ||||
|       default = "searx"; | ||||
|     }; | ||||
|   }; | ||||
| 
 | ||||
|   config = lib.mkIf config.services.searx.enable { | ||||
|     sops.secrets = { | ||||
|       "services/searx" = { | ||||
|         sopsFile = "${inputs.secrets}/defiant-services.yaml"; | ||||
|       }; | ||||
|     }; | ||||
| 
 | ||||
|     services.searx = { | ||||
|       environmentFile = config.sops.secrets."services/searx".path; | ||||
| 
 | ||||
|       # Rate limiting | ||||
|       limiterSettings = { | ||||
|         real_ip = { | ||||
|           x_for = 1; | ||||
|           ipv4_prefix = 32; | ||||
|           ipv6_prefix = 56; | ||||
|         }; | ||||
| 
 | ||||
|         botdetection = { | ||||
|           ip_limit = { | ||||
|             filter_link_local = true; | ||||
|             link_token = true; | ||||
|           }; | ||||
|         }; | ||||
|       }; | ||||
| 
 | ||||
|       settings = { | ||||
|         server = { | ||||
|           port = 8083; | ||||
|           secret_key = "@SEARXNG_SECRET@"; | ||||
|         }; | ||||
| 
 | ||||
|         # Search engine settings | ||||
|         search = { | ||||
|           safe_search = 2; | ||||
|           autocomplete_min = 2; | ||||
|           autocomplete = "duckduckgo"; | ||||
|         }; | ||||
| 
 | ||||
|         # Enabled plugins | ||||
|         enabled_plugins = [ | ||||
|           "Basic Calculator" | ||||
|           "Hash plugin" | ||||
|           "Tor check plugin" | ||||
|           "Open Access DOI rewrite" | ||||
|           "Hostnames plugin" | ||||
|           "Unit converter plugin" | ||||
|           "Tracker URL remover" | ||||
|         ]; | ||||
|       }; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue