Rclone: Difference between revisions
m Category:CLI Applications added |
m fix indentation |
||
| (One intermediate revision by one other user not shown) | |||
| Line 27: | Line 27: | ||
== Configuration with Home-Manager == | == Configuration with Home-Manager == | ||
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 ]; | |||
xdg.configFile."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 39: | Line 39: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
xdg.configFile."rclone/example.conf".text = '' | |||
[fichier] | [fichier] | ||
type = fichier | type = fichier | ||
user = foo@bar.com | user = foo@bar.com | ||
pass = p4ssw0rd | pass = p4ssw0rd | ||
''; | ''; | ||
}; | |||
systemd.user.services.example-mounts = { | |||
Unit = { | |||
Description = "Example programmatic mount configuration with nix and home-manager."; | |||
After = [ "network-online.target" ]; | |||
}; | }; | ||
Service = { | |||
Type = "notify"; | |||
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:\" \"%h/Example Sync Dir\""; | |||
ExecStop="/run/wrappers/bin/fusermount -u %h/Example Sync Dir/%i"; | |||
}; | }; | ||
Install.WantedBy = [ "default.target" ]; | |||
}; | |||
</syntaxhighlight> | </syntaxhighlight> | ||