infrastructure/deployments/mirror/rclone_mount.nix

22 lines
809 B
Nix

{ pkgs, ... }:
{
systemd.services.rclone_mount = {
enable = true;
description = "RClone Mount";
serviceConfig = {
Type = "notify";
KillMode = "none";
User = "root";
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 72h0m0s --vfs-cache-max-size 5Gi";
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"];
};
}