added syncthing backups.
This commit is contained in:
		
							parent
							
								
									97238bddbd
								
							
						
					
					
						commit
						811dfa165e
					
				
					 3 changed files with 26 additions and 2 deletions
				
			
		| 
						 | 
					@ -123,8 +123,6 @@
 | 
				
			||||||
      sshUser = "root";
 | 
					      sshUser = "root";
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    packages.x86_64-linux = {
 | 
					    packages.x86_64-linux = {
 | 
				
			||||||
      proxmox = import ./packages/proxmox.nix {inherit inputs configLib;};
 | 
					      proxmox = import ./packages/proxmox.nix {inherit inputs configLib;};
 | 
				
			||||||
      iso = import ./packages/iso.nix {inherit inputs configLib;};
 | 
					      iso = import ./packages/iso.nix {inherit inputs configLib;};
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,6 +8,7 @@
 | 
				
			||||||
  imports = [
 | 
					  imports = [
 | 
				
			||||||
    ../../configs/nixos/nginx.nix
 | 
					    ../../configs/nixos/nginx.nix
 | 
				
			||||||
  ];
 | 
					  ];
 | 
				
			||||||
 | 
					  services.nginx.clientMaxBodySize="100m";
 | 
				
			||||||
  services.nginx.virtualHosts = {
 | 
					  services.nginx.virtualHosts = {
 | 
				
			||||||
    "gabevenberg.com" = {
 | 
					    "gabevenberg.com" = {
 | 
				
			||||||
      enableACME = true;
 | 
					      enableACME = true;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -27,8 +27,33 @@ in {
 | 
				
			||||||
      path = "/backup/restic/.htpasswd";
 | 
					      path = "/backup/restic/.htpasswd";
 | 
				
			||||||
      owner="restic";
 | 
					      owner="restic";
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					    secrets.restic-url = {
 | 
				
			||||||
 | 
					      sopsFile = "${inputs.nix-secrets}/restic-client.yaml";
 | 
				
			||||||
 | 
					      owner = config.host.user;
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    secrets.restic-password = {
 | 
				
			||||||
 | 
					      sopsFile = "${inputs.nix-secrets}/restic-client.yaml";
 | 
				
			||||||
 | 
					      owner = config.host.user;
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  environment.systemPackages = with pkgs; [
 | 
					  environment.systemPackages = with pkgs; [
 | 
				
			||||||
    restic
 | 
					    restic
 | 
				
			||||||
  ];
 | 
					  ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  services.restic.backups = lib.mkIf (inputs ? nix-secrets) {
 | 
				
			||||||
 | 
					    remote = {
 | 
				
			||||||
 | 
					      repositoryFile = config.sops.secrets.restic-url.path;
 | 
				
			||||||
 | 
					      passwordFile = config.sops.secrets.restic-password.path;
 | 
				
			||||||
 | 
					      initialize = true;
 | 
				
			||||||
 | 
					      paths = [
 | 
				
			||||||
 | 
					        "/storage/syncthing"
 | 
				
			||||||
 | 
					      ];
 | 
				
			||||||
 | 
					      timerConfig = {
 | 
				
			||||||
 | 
					        OnCalendar = "daily";
 | 
				
			||||||
 | 
					        Persistent = true;
 | 
				
			||||||
 | 
					        RandomizedDelaySec = "4h";
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue