diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-10-03 22:06:43 +0200 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-10-03 22:06:43 +0200 |
commit | 342155ced8fc78b608f23454cb631decb0b7be9b (patch) | |
tree | 2cc4ffc422d645e17cf456cdcc780287df311b3f /programs/rclone.nix | |
parent | 5d3c8e21d2d79a6ed3e324b833002a9bb0317b34 (diff) | |
download | dots-342155ced8fc78b608f23454cb631decb0b7be9b.tar.gz dots-342155ced8fc78b608f23454cb631decb0b7be9b.zip |
Update config
Diffstat (limited to 'programs/rclone.nix')
-rw-r--r-- | programs/rclone.nix | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/programs/rclone.nix b/programs/rclone.nix new file mode 100644 index 0000000..a8c4782 --- /dev/null +++ b/programs/rclone.nix @@ -0,0 +1,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" ]; + }; + }; + }; +} |