dotfiles/nixos/configs/mount-rsync-kate.nix
2024-11-07 16:25:41 -07:00

37 lines
953 B
Nix

#
# Automatically mount our rsync.net backup site.
#
# vim: et:ts=2:sw=2:
#
{ pkgs, ... }:
{
config = {
systemd.services.rsync-kate = {
description = "rsync-kate mount";
# Start once we're online.
wantedBy = [ "default.target" ];
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
# Run using our local rclone config.
environment = {
HOME = "/home/deprekated";
};
# Ensure our mountpoint exists.
preStart = ''
${pkgs.umount}/bin/umount /home/deprekated/rsync-kate || true
mkdir -p /home/deprekated/rsync-kate
'';
# Run rclone mount.
serviceConfig = {
Type = "notify";
ExecStart = "${pkgs.rclone}/bin/rclone mount --allow-other --uid 1000 --gid 100 --file-perms 600 --dir-perms 700 --vfs-cache-mode full rsync-kate:. /home/deprekated/rsync-kate";
Restart = "on-failure";
};
};
};
}