about summary refs log tree commit diff
path: root/programs/rclone.nix
blob: 78dedf09d62d8cf18f954489bb4fa1a008122f90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{ pkgs, config, ... }:

let
    mountdir = "${config.home.homeDirectory}/zhr/drive";
in
{
  home.packages = with pkgs; [
    rclone
  ];

    systemd.user = {
        services.gdrive_mount = {
            Unit = {
                Description = "mount google-drive dirs";
            };
            Install.WantedBy = [ "multi-user.target" ];
            Service = {
                # ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p ${mountdir}";
                ExecStart = ''
                    ${pkgs.rclone}/bin/rclone mount zhr-drive: ${mountdir}
                '';
                # ExecStop = "${pkgs.coreutils}/bin/umount ${mountdir}";
                Type = "notify";
                Restart = "always";
                RestartSec = "10s";
                # Environment = [ "PATH=${pkgs.fuse}/bin:$PATH" ];
            };
        };
    };
}