infrastructure/deployments/mirror/rclone_mount.nix

22 lines
834 B
Nix
Raw Normal View History

2023-04-12 12:47:22 +00:00
{ pkgs, ... }:
{
systemd.services.rclone_mount = {
enable = true;
description = "RClone Mount";
serviceConfig = {
Type = "notify";
KillMode = "none";
User = "root";
2023-05-07 11:17:39 +00:00
ExecStart = "${pkgs.rclone}/bin/rclone mount master:/mnt/data /var/www/mirror --allow-other --dir-cache-time=5m --log-level INFO --umask 002 --cache-dir /mnt/cache --vfs-cache-mode full --vfs-cache-max-age 168h0m0s --vfs-cache-max-size 80Gi --vfs-fast-fingerprint";
2023-04-12 12:47:22 +00:00
ExecStop = "/run/wrappers/bin/fusermount -uz /var/www/mirror";
Restart = "on-failure";
Environment = [ "PATH=/run/wrappers/bin/:$PATH" ];
};
wantedBy = [ "multi-user.target"];
wants = [ "network-online.target"];
after = [ "network-online.target"];
};
}