ookflix: add containers
This commit is contained in:
		
							parent
							
								
									4ee2e2a877
								
							
						
					
					
						commit
						79a37fa8eb
					
				
					 13 changed files with 303 additions and 68 deletions
				
			
		
							
								
								
									
										44
									
								
								modules/nixos/server/services/ookflix/sonarr.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								modules/nixos/server/services/ookflix/sonarr.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,44 @@ | |||
| { | ||||
|   config, | ||||
|   lib, | ||||
|   ook, | ||||
|   self, | ||||
|   ... | ||||
| }: let | ||||
|   ookflixLib = import ./lib.nix {inherit lib config self;}; | ||||
|   inherit (ookflixLib) mkServiceUser mkServiceStateDir; | ||||
|   inherit (lib) mkIf; | ||||
|   inherit (ook.lib.container) mkContainerLabel mkContainerEnvironment mkContainerPort; | ||||
|   inherit (config.ooknet.server.ookflix) groups volumes; | ||||
|   inherit (config.ooknet.server.ookflix.services) sonarr; | ||||
| in { | ||||
|   config = mkIf sonarr.enable { | ||||
|     users = mkServiceUser sonarr.user.name; | ||||
|     systemd.tmpfiles = mkServiceStateDir "sonarr" sonarr.stateDir; | ||||
|     virtualisation.oci-containers.containers = { | ||||
|       sonarr = { | ||||
|         image = "ghcr.io/hotio/sonarr"; | ||||
|         autoStart = true; | ||||
|         hostname = "sonarr"; | ||||
|         ports = [(mkContainerPort sonarr.port)]; | ||||
|         volumes = [ | ||||
|           "${sonarr.stateDir}:/config" | ||||
|           "${volumes.data.root}:/data" | ||||
|         ]; | ||||
|         labels = mkContainerLabel { | ||||
|           name = "sonarr"; | ||||
|           inherit (sonarr) port domain; | ||||
|           homepage = { | ||||
|             group = "arr"; | ||||
|             description = "media-server tv downloader"; | ||||
|           }; | ||||
|         }; | ||||
|         environment = | ||||
|           mkContainerEnvironment sonarr.user.id groups.media.id | ||||
|           // { | ||||
|             UMASK = "002"; | ||||
|           }; | ||||
|       }; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue