forked from jan-leila/nix-config
		
	feat: installed bazarr, radarr, and sonarr
This commit is contained in:
		
							parent
							
								
									4d52c58f79
								
							
						
					
					
						commit
						f9fe74cc8a
					
				
					 11 changed files with 201 additions and 3 deletions
				
			
		
							
								
								
									
										6
									
								
								modules/nixos-modules/server/bazarr/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								modules/nixos-modules/server/bazarr/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| {...}: { | ||||
|   imports = [ | ||||
|     ./proxy.nix | ||||
|     ./impermanence.nix | ||||
|   ]; | ||||
| } | ||||
							
								
								
									
										26
									
								
								modules/nixos-modules/server/bazarr/impermanence.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								modules/nixos-modules/server/bazarr/impermanence.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,26 @@ | |||
| { | ||||
|   lib, | ||||
|   config, | ||||
|   ... | ||||
| }: let | ||||
|   bazarr_data_directory = "/var/lib/bazarr"; | ||||
| in { | ||||
|   config = lib.mkIf (config.services.bazarr.enable && config.host.impermanence.enable) { | ||||
|     assertions = [ | ||||
|       { | ||||
|         assertion = config.services.bazarr.dataDir == bazarr_data_directory; | ||||
|         message = "bazarr data directory does not match persistence"; | ||||
|       } | ||||
|     ]; | ||||
| 
 | ||||
|     environment.persistence."/persist/system/root" = { | ||||
|       directories = [ | ||||
|         { | ||||
|           directory = bazarr_data_directory; | ||||
|           user = "bazarr"; | ||||
|           group = "bazarr"; | ||||
|         } | ||||
|       ]; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
							
								
								
									
										28
									
								
								modules/nixos-modules/server/bazarr/proxy.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								modules/nixos-modules/server/bazarr/proxy.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,28 @@ | |||
| { | ||||
|   lib, | ||||
|   config, | ||||
|   ... | ||||
| }: { | ||||
|   options.services.bazarr = { | ||||
|     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.bazarr.enable && config.services.bazarr.subdomain != null) { | ||||
|     host.reverse_proxy.subdomains.bazarr = { | ||||
|       subdomain = config.services.bazarr.subdomain; | ||||
|       extraSubdomains = config.services.bazarr.extraSubdomains; | ||||
|       target = "http://127.0.0.1:6767"; | ||||
|       websockets.enable = true; | ||||
|       forwardHeaders.enable = true; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
|  | @ -7,14 +7,17 @@ | |||
|     ./podman.nix | ||||
| 
 | ||||
|     ./actual | ||||
|     ./immich | ||||
|     ./panoramax | ||||
|     ./bazarr | ||||
|     ./forgejo | ||||
|     ./home-assistant | ||||
|     ./immich | ||||
|     ./jellyfin | ||||
|     ./panoramax | ||||
|     ./paperless | ||||
|     ./searx | ||||
|     ./qbittorent.nix | ||||
|     ./radarr | ||||
|     ./searx | ||||
|     ./sonarr | ||||
|     ./wyoming.nix | ||||
|   ]; | ||||
| } | ||||
|  |  | |||
							
								
								
									
										6
									
								
								modules/nixos-modules/server/radarr/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								modules/nixos-modules/server/radarr/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| {...}: { | ||||
|   imports = [ | ||||
|     ./proxy.nix | ||||
|     ./impermanence.nix | ||||
|   ]; | ||||
| } | ||||
							
								
								
									
										26
									
								
								modules/nixos-modules/server/radarr/impermanence.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								modules/nixos-modules/server/radarr/impermanence.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,26 @@ | |||
| { | ||||
|   lib, | ||||
|   config, | ||||
|   ... | ||||
| }: let | ||||
|   radarr_data_directory = "/var/lib/radarr/.config/Radarr"; | ||||
| in { | ||||
|   config = lib.mkIf (config.services.radarr.enable && config.host.impermanence.enable) { | ||||
|     assertions = [ | ||||
|       { | ||||
|         assertion = config.services.radarr.dataDir == radarr_data_directory; | ||||
|         message = "radarr data directory does not match persistence"; | ||||
|       } | ||||
|     ]; | ||||
| 
 | ||||
|     environment.persistence."/persist/system/root" = { | ||||
|       directories = [ | ||||
|         { | ||||
|           directory = radarr_data_directory; | ||||
|           user = "radarr"; | ||||
|           group = "radarr"; | ||||
|         } | ||||
|       ]; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
							
								
								
									
										28
									
								
								modules/nixos-modules/server/radarr/proxy.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								modules/nixos-modules/server/radarr/proxy.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,28 @@ | |||
| { | ||||
|   lib, | ||||
|   config, | ||||
|   ... | ||||
| }: { | ||||
|   options.services.radarr = { | ||||
|     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.radarr.enable && config.services.radarr.subdomain != null) { | ||||
|     host.reverse_proxy.subdomains.radarr = { | ||||
|       subdomain = config.services.radarr.subdomain; | ||||
|       extraSubdomains = config.services.radarr.extraSubdomains; | ||||
|       target = "http://127.0.0.1:7878"; | ||||
|       websockets.enable = true; | ||||
|       forwardHeaders.enable = true; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
							
								
								
									
										6
									
								
								modules/nixos-modules/server/sonarr/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								modules/nixos-modules/server/sonarr/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| {...}: { | ||||
|   imports = [ | ||||
|     ./proxy.nix | ||||
|     ./impermanence.nix | ||||
|   ]; | ||||
| } | ||||
							
								
								
									
										26
									
								
								modules/nixos-modules/server/sonarr/impermanence.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								modules/nixos-modules/server/sonarr/impermanence.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,26 @@ | |||
| { | ||||
|   lib, | ||||
|   config, | ||||
|   ... | ||||
| }: let | ||||
|   sonarr_data_directory = "/var/lib/sonarr/.config/NzbDrone"; | ||||
| in { | ||||
|   config = lib.mkIf (config.services.sonarr.enable && config.host.impermanence.enable) { | ||||
|     assertions = [ | ||||
|       { | ||||
|         assertion = config.services.sonarr.dataDir == sonarr_data_directory; | ||||
|         message = "sonarr data directory does not match persistence"; | ||||
|       } | ||||
|     ]; | ||||
| 
 | ||||
|     environment.persistence."/persist/system/root" = { | ||||
|       directories = [ | ||||
|         { | ||||
|           directory = sonarr_data_directory; | ||||
|           user = "sonarr"; | ||||
|           group = "sonarr"; | ||||
|         } | ||||
|       ]; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
							
								
								
									
										28
									
								
								modules/nixos-modules/server/sonarr/proxy.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								modules/nixos-modules/server/sonarr/proxy.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,28 @@ | |||
| { | ||||
|   lib, | ||||
|   config, | ||||
|   ... | ||||
| }: { | ||||
|   options.services.sonarr = { | ||||
|     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.sonarr.enable && config.services.sonarr.subdomain != null) { | ||||
|     host.reverse_proxy.subdomains.sonarr = { | ||||
|       subdomain = config.services.sonarr.subdomain; | ||||
|       extraSubdomains = config.services.sonarr.extraSubdomains; | ||||
|       target = "http://127.0.0.1:8989"; | ||||
|       websockets.enable = true; | ||||
|       forwardHeaders.enable = true; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue