Set up PostgreSQL with daily backups
This commit is contained in:
		
							parent
							
								
									9b0c99672a
								
							
						
					
					
						commit
						b15da3a2e5
					
				@ -23,11 +23,26 @@
 | 
				
			|||||||
      fsType = "zfs";
 | 
					      fsType = "zfs";
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  fileSystems."/vault/git" =
 | 
				
			||||||
 | 
					    { device = "vault/git";
 | 
				
			||||||
 | 
					      fsType = "zfs";
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  fileSystems."/vault/syncthing" =
 | 
				
			||||||
 | 
					    { device = "vault/syncthing";
 | 
				
			||||||
 | 
					      fsType = "zfs";
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  fileSystems."/vault/backups" =
 | 
					  fileSystems."/vault/backups" =
 | 
				
			||||||
    { device = "vault/backups";
 | 
					    { device = "vault/backups";
 | 
				
			||||||
      fsType = "zfs";
 | 
					      fsType = "zfs";
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  fileSystems."/vault/nextcloud" =
 | 
				
			||||||
 | 
					    { device = "vault/nextcloud";
 | 
				
			||||||
 | 
					      fsType = "zfs";
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  fileSystems."/vault/backups/monolith" =
 | 
					  fileSystems."/vault/backups/monolith" =
 | 
				
			||||||
    { device = "vault/backups/monolith";
 | 
					    { device = "vault/backups/monolith";
 | 
				
			||||||
      fsType = "zfs";
 | 
					      fsType = "zfs";
 | 
				
			||||||
@ -38,18 +53,8 @@
 | 
				
			|||||||
      fsType = "zfs";
 | 
					      fsType = "zfs";
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  fileSystems."/vault/git" =
 | 
					  fileSystems."/vault/backups/zion/databases" =
 | 
				
			||||||
    { device = "vault/git";
 | 
					    { device = "vault/backups/zion/databases";
 | 
				
			||||||
      fsType = "zfs";
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  fileSystems."/vault/nextcloud" =
 | 
					 | 
				
			||||||
    { device = "vault/nextcloud";
 | 
					 | 
				
			||||||
      fsType = "zfs";
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  fileSystems."/vault/syncthing" =
 | 
					 | 
				
			||||||
    { device = "vault/syncthing";
 | 
					 | 
				
			||||||
      fsType = "zfs";
 | 
					      fsType = "zfs";
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -7,6 +7,7 @@
 | 
				
			|||||||
    php
 | 
					    php
 | 
				
			||||||
    postgresql_11
 | 
					    postgresql_11
 | 
				
			||||||
    libressl
 | 
					    libressl
 | 
				
			||||||
 | 
					    wallabag
 | 
				
			||||||
  ];
 | 
					  ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  services.nginx = {
 | 
					  services.nginx = {
 | 
				
			||||||
@ -73,9 +74,20 @@
 | 
				
			|||||||
    };
 | 
					    };
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # Generate dhparams
 | 
				
			||||||
  security.dhparams = {
 | 
					  security.dhparams = {
 | 
				
			||||||
    enable = true;
 | 
					    enable = true;
 | 
				
			||||||
    params = { nginx.bits = 2048; };
 | 
					    params = { nginx.bits = 2048; };
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # Enable PostgreSQL with daily backup
 | 
				
			||||||
 | 
					  services.postgresql.enable = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  services.postgresqlBackup = {
 | 
				
			||||||
 | 
					      enable = true;
 | 
				
			||||||
 | 
					      backupAll = true;
 | 
				
			||||||
 | 
					      location = "/vault/backups/zion/databases";
 | 
				
			||||||
 | 
					      startAt = "*-*-* 05:15:00";
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user