{ pkgs, ... }@all: with all; {
	home.packages = with pkgs; [ rclone ];
  sops.secrets."nx2site/copyparty/user-password/${hyper.user}".path = "%r/secrets/copyparty/user-password/${hyper.user}";
	programs.rclone = {
		enable = true;
		package = pkgs.rclone;
		remotes = {
			"file.${hyper.domain}" = {
				config = {
					type = "webdav";
					vendor = "owncloud"; # copyparty
					url = "https://file.${hyper.domain}/";
					user = hyper.user;
					pacer_min_sleep = "0.01ms";
				};
				mounts = {
					"" = {
						enable = true;
						mountPoint = "${hyper.home}/file.nx2.site/";
						options = {
							vfs-cache-mode = "writes";
							dir-cache-time = "5s";
						};
					};
				};
				secrets = {
					pass = "/run/user/1000/secrets/copyparty/user-password/${hyper.user}";
				};
			};
		};
	};
}

