forked from jan-leila/nix-config
		
	feat: created db config for panoramax
This commit is contained in:
		
							parent
							
								
									7e6fa744af
								
							
						
					
					
						commit
						333c68a8cd
					
				
					 3 changed files with 31 additions and 0 deletions
				
			
		|  | @ -308,6 +308,7 @@ | ||||||
| 
 | 
 | ||||||
|     panoramax = { |     panoramax = { | ||||||
|       enable = true; |       enable = true; | ||||||
|  |       openFirewall = true; | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     qbittorrent = { |     qbittorrent = { | ||||||
|  |  | ||||||
							
								
								
									
										29
									
								
								modules/nixos-modules/server/panoramax/database.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								modules/nixos-modules/server/panoramax/database.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,29 @@ | ||||||
|  | { | ||||||
|  |   lib, | ||||||
|  |   config, | ||||||
|  |   ... | ||||||
|  | }: { | ||||||
|  |   config = lib.mkIf config.services.panoramax.enable (lib.mkMerge [ | ||||||
|  |     { | ||||||
|  |       host = { | ||||||
|  |         postgres = { | ||||||
|  |           enable = true; | ||||||
|  |         }; | ||||||
|  |       }; | ||||||
|  |     } | ||||||
|  |     (lib.mkIf config.host.postgres.enable { | ||||||
|  |       host = { | ||||||
|  |         postgres = { | ||||||
|  |           extraUsers = { | ||||||
|  |             ${config.services.panoramax.database.user} = { | ||||||
|  |               isClient = true; | ||||||
|  |             }; | ||||||
|  |           }; | ||||||
|  |           extraDatabases = { | ||||||
|  |             ${config.services.panoramax.database.name} = {}; | ||||||
|  |           }; | ||||||
|  |         }; | ||||||
|  |       }; | ||||||
|  |     }) | ||||||
|  |   ]); | ||||||
|  | } | ||||||
|  | @ -4,5 +4,6 @@ | ||||||
|     ./fail2ban.nix |     ./fail2ban.nix | ||||||
|     ./impermanence.nix |     ./impermanence.nix | ||||||
|     ./panoramax.nix |     ./panoramax.nix | ||||||
|  |     ./database.nix | ||||||
|   ]; |   ]; | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue