Rclone: Difference between revisions

H7x4 (talk | contribs)
m Fix systemd capitalization
Bachp (talk | contribs)
Use proper path to mkdir and fusermount
 
(2 intermediate revisions by 2 users not shown)
Line 28: Line 28:
Home-manager users may wish to make a user-centric configuration of rclone. To do so add <code>pkgs.rclone</code> to your <code>~/.config/home-manager/home.nix</code> file. You can also configure remotes with home-manager. Here is an example below.<syntaxhighlight lang="nix">
Home-manager users may wish to make a user-centric configuration of rclone. To do so add <code>pkgs.rclone</code> to your <code>~/.config/home-manager/home.nix</code> file. You can also configure remotes with home-manager. Here is an example below.<syntaxhighlight lang="nix">
   home.packages = [ pkgs.rclone ];
   home.packages = [ pkgs.rclone ];
   home.file = {
   xdg.configFile."rclone/rclone.conf".text = ''
      ".config/rclone/rclone.conf".text = ''
[fichier]
[fichier]
type = fichier
type = fichier
user = foo@bar.com
user = foo@bar.com
pass = password
pass = password
    '';
  '';
  };
</syntaxhighlight>
</syntaxhighlight>


Line 41: Line 39:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
   home.file = {
   xdg.configFile."rclone/example.conf".text = ''
      ".config/rclone/example.conf".text = ''
[fichier]
[fichier]
type = fichier
type = fichier
user = foo@bar.com
user = foo@bar.com
pass = p4ssw0rd
pass = p4ssw0rd
    '';
'';
   };
   };


Line 57: Line 54:
     Service = {
     Service = {
       Type = "notify";
       Type = "notify";
       ExecStartPre = "/usr/bin/env mkdir -p %h/Example Sync Dir";
       ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p %h/Example Sync Dir";
       ExecStart = "${pkgs.rclone}/bin/rclone --config=%h/.config/rclone/example.conf --vfs-cache-mode writes --ignore-checksum mount \"fichier:\" \"Example Sync Dir\"";
       ExecStart = "${pkgs.rclone}/bin/rclone --config=%h/.config/rclone/example.conf --vfs-cache-mode writes --ignore-checksum mount \"fichier:\" \"%h/Example Sync Dir\"";
       ExecStop="/bin/fusermount -u %h/Example Sync Dir/%i";
       ExecStop="/run/wrappers/bin/fusermount -u %h/Example Sync Dir/%i";
     };
     };
     Install.WantedBy = [ "default.target" ];
     Install.WantedBy = [ "default.target" ];
Line 65: Line 62:
</syntaxhighlight>
</syntaxhighlight>


  [[Category:Applications]]
[[Category:Applications]]
[[Category:CLI Applications]]
[[Category:Backup]]
[[Category:Backup]]