forked from jan-leila/nix-config
		
	refactor: split configurations for fail2ban, postgres, and qbittorent into folders
This commit is contained in:
		
							parent
							
								
									ad04be6534
								
							
						
					
					
						commit
						0f5507c328
					
				
					 13 changed files with 296 additions and 263 deletions
				
			
		
							
								
								
									
										27
									
								
								modules/nixos-modules/server/postgres/impermanence.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								modules/nixos-modules/server/postgres/impermanence.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,27 @@ | |||
| { | ||||
|   config, | ||||
|   lib, | ||||
|   ... | ||||
| }: let | ||||
|   dataDir = "/var/lib/postgresql/16"; | ||||
| in { | ||||
|   config = lib.mkIf (config.host.postgres.enable && config.host.impermanence.enable) { | ||||
|     assertions = [ | ||||
|       { | ||||
|         assertion = config.services.postgresql.dataDir == dataDir; | ||||
|         message = "postgres data directory does not match persistence"; | ||||
|       } | ||||
|     ]; | ||||
|     environment.persistence."/persist/system/root" = { | ||||
|       enable = true; | ||||
|       hideMounts = true; | ||||
|       directories = [ | ||||
|         { | ||||
|           directory = dataDir; | ||||
|           user = "postgres"; | ||||
|           group = "postgres"; | ||||
|         } | ||||
|       ]; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue