forked from jan-leila/nix-config
		
	feat: installed jackett
This commit is contained in:
		
							parent
							
								
									e895fa5edd
								
							
						
					
					
						commit
						6afdcce951
					
				
					 5 changed files with 65 additions and 0 deletions
				
			
		|  | @ -362,6 +362,10 @@ | ||||||
|       enable = true; |       enable = true; | ||||||
|       openFirewall = true; |       openFirewall = true; | ||||||
|     }; |     }; | ||||||
|  |     jackett = { | ||||||
|  |       enable = true; | ||||||
|  |       openFirewall = true; | ||||||
|  |     }; | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   # disable computer sleeping |   # disable computer sleeping | ||||||
|  |  | ||||||
|  | @ -18,6 +18,7 @@ | ||||||
|     ./radarr |     ./radarr | ||||||
|     ./searx |     ./searx | ||||||
|     ./sonarr |     ./sonarr | ||||||
|  |     ./jackett | ||||||
|     ./wyoming.nix |     ./wyoming.nix | ||||||
|   ]; |   ]; | ||||||
| } | } | ||||||
|  |  | ||||||
							
								
								
									
										6
									
								
								modules/nixos-modules/server/jackett/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								modules/nixos-modules/server/jackett/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | ||||||
|  | {...}: { | ||||||
|  |   imports = [ | ||||||
|  |     ./proxy.nix | ||||||
|  |     ./impermanence.nix | ||||||
|  |   ]; | ||||||
|  | } | ||||||
							
								
								
									
										26
									
								
								modules/nixos-modules/server/jackett/impermanence.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								modules/nixos-modules/server/jackett/impermanence.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,26 @@ | ||||||
|  | { | ||||||
|  |   lib, | ||||||
|  |   config, | ||||||
|  |   ... | ||||||
|  | }: let | ||||||
|  |   jackett_data_directory = "/var/lib/jackett/.config/Jackett"; | ||||||
|  | in { | ||||||
|  |   config = lib.mkIf (config.services.jackett.enable && config.host.impermanence.enable) { | ||||||
|  |     assertions = [ | ||||||
|  |       { | ||||||
|  |         assertion = config.services.jackett.dataDir == jackett_data_directory; | ||||||
|  |         message = "jackett data directory does not match persistence"; | ||||||
|  |       } | ||||||
|  |     ]; | ||||||
|  | 
 | ||||||
|  |     environment.persistence."/persist/system/root" = { | ||||||
|  |       directories = [ | ||||||
|  |         { | ||||||
|  |           directory = jackett_data_directory; | ||||||
|  |           user = "jackett"; | ||||||
|  |           group = "jackett"; | ||||||
|  |         } | ||||||
|  |       ]; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  | } | ||||||
							
								
								
									
										28
									
								
								modules/nixos-modules/server/jackett/proxy.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								modules/nixos-modules/server/jackett/proxy.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,28 @@ | ||||||
|  | { | ||||||
|  |   lib, | ||||||
|  |   config, | ||||||
|  |   ... | ||||||
|  | }: { | ||||||
|  |   options.services.jackett = { | ||||||
|  |     subdomain = lib.mkOption { | ||||||
|  |       type = lib.types.nullOr lib.types.str; | ||||||
|  |       default = null; | ||||||
|  |       description = "Subdomain for reverse proxy. If null, service will be local only."; | ||||||
|  |     }; | ||||||
|  |     extraSubdomains = lib.mkOption { | ||||||
|  |       type = lib.types.listOf lib.types.str; | ||||||
|  |       default = []; | ||||||
|  |       description = "Extra subdomains for reverse proxy."; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  | 
 | ||||||
|  |   config = lib.mkIf (config.services.jackett.enable && config.services.jackett.subdomain != null) { | ||||||
|  |     host.reverse_proxy.subdomains.jackett = { | ||||||
|  |       subdomain = config.services.jackett.subdomain; | ||||||
|  |       extraSubdomains = config.services.jackett.extraSubdomains; | ||||||
|  |       target = "http://127.0.0.1:9117"; | ||||||
|  |       websockets.enable = true; | ||||||
|  |       forwardHeaders.enable = true; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  | } | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue