programs.rclone.enable
Whether to enable rclone.
Type: boolean
Default:
false
Example:
true
Declared by:
programs.rclone.package
The rclone package to use.
Type: package
Default:
pkgs.rclone
Declared by:
programs.rclone.remotes
An attribute set of remote configurations. Each remote consists of regular configuration options and optional secrets.
See https://rclone.org/docs/ for more information on configuring specific remotes.
Type: attribute set of (submodule)
Default:
{ }
Example:
{
b2 = {
config = {
type = "b2";
hard_delete = true;
};
secrets = {
# using sops
account = config.sops.secrets.b2-acc-id.path;
# using agenix
key = config.age.secrets.b2-key.path;
};
};
server.config = {
type = "sftp";
host = "server";
user = "backup";
key_file = "${home.homeDirectory}/.ssh/id_ed25519";
};
}
Declared by:
programs.rclone.remotes.<name>.config
Regular configuration options as described in rclone’s documentation https://rclone.org/docs/. When specifying options follow the formatting process outlined here https://rclone.org/docs/#config-config-file, namely:
- Remove the leading double-dash (–) from the rclone option name
- Replace hyphens (-) with underscores (_)
- Convert to lowercase
- Use the resulting string as your configuration key
For example, the rclone option “–mega-hard-delete” would use “hard_delete” as the config key.
Security Note: Always use the secrets option for sensitive data
instead of the config option to prevent exposing credentials to
the world-readable Nix store.
Type: An attribute set containing a remote type and options.
Default:
{ }
Example:
{
type = "mega"; # Required - specifies the remote type
user = "you@example.com";
hard_delete = true;
}
Declared by:
programs.rclone.remotes.<name>.mounts
An attribute set mapping remote file paths to their corresponding mount point configurations.
For each entry, to perform the equivalent of
rclone mount remote:path/to/files /path/to/local/mount — as described in the
rclone documentation https://rclone.org/commands/rclone_mount/ — we create
a key-value pair like this:
"path/to/files/on/remote" = { ... }.
On macOS, FUSE mounts additionally require macFUSE (https://osxfuse.github.io/) to be installed and its system extension approved. Home Manager does not install macFUSE; rclone will surface a runtime error if it is missing.
Type: attribute set of (submodule)
Default:
{ }
Example:
{
"path/to/files" = {
enable = true;
mountPoint = "/home/alice/rclone-mount";
options = {
dir-cache-time = "5000h";
poll-interval = "10s";
umask = "002";
user-agent = "Laptop";
};
};
}
Declared by:
programs.rclone.remotes.<name>.mounts.<name>.enable
Whether to enable this mount.
Type: boolean
Default:
false
Example:
true
Declared by:
programs.rclone.remotes.<name>.mounts.<name>.autoMount
Whether to enable automatically mounting the remote on login.
Type: boolean
Default:
true
Example:
true
Declared by:
programs.rclone.remotes.<name>.mounts.<name>.logLevel
Set the log level. See https://rclone.org/docs/#logging for more.
Type: one of <null>, “ERROR”, “NOTICE”, “INFO”, “DEBUG”
Default:
null
Example:
"INFO"
Declared by:
programs.rclone.remotes.<name>.mounts.<name>.mountPoint
A local file path specifying the location of the mount point.
Type: string
Default:
null
Example:
"/home/alice/my-remote"
Declared by:
programs.rclone.remotes.<name>.mounts.<name>.options
An attribute set of option values passed to the command.
To set a boolean option, assign it true or false. See
https://nixos.org/manual/nixpkgs/stable/#function-library-lib.cli.toCommandLineShellGNU
for more details on the format.
Some caching options are set by default, namely vfs-cache-mode = "full"
and cache-dir. These can be overridden if desired.
Type: attribute set of (null or boolean or signed integer or floating point number or string)
Default:
{ }
Declared by:
programs.rclone.remotes.<name>.secrets
Sensitive configuration values such as passwords, API keys, and tokens. These must be provided as file paths to the secrets, which will be read at activation time.
These values are expanded in a shell context within the rclone-config service (a systemd user service on Linux, a launchd agent on macOS), so you can use bash features like command substitution or variable expansion (e.g. “${XDG_RUNTIME_DIR}” on Linux, as used by agenix).
Type: attribute set of string
Default:
{ }
Example:
{
password = "/run/secrets/password";
api_key = config.age.secrets.api-key.path;
}
Declared by:
programs.rclone.remotes.<name>.serve
An attribute set mapping remote file paths to their corresponding serve configurations.
For each entry, to perform the equivalent of
rclone serve protocol remote:path/to/files — as described in the
rclone documentation https://rclone.org/commands/rclone_serve/ — we create
a key-value pair like this:
"path/to/files/on/remote" = { ... }.
Type: attribute set of (submodule)
Default:
{ }
Example:
{
"path/to/files" = {
enable = true;
protocol = "http";
options = {
addr = "127.0.0.1:3000";
dir-cache-time = "5000h";
poll-interval = "10s";
umask = "002";
user-agent = "Laptop";
};
};
}
Declared by:
programs.rclone.remotes.<name>.serve.<name>.enable
Whether to enable serving this path.
Type: boolean
Default:
false
Example:
true
Declared by:
programs.rclone.remotes.<name>.serve.<name>.autoStart
Whether to enable automatically serving the remote on login.
Type: boolean
Default:
true
Example:
true
Declared by:
programs.rclone.remotes.<name>.serve.<name>.logLevel
Set the log level. See https://rclone.org/docs/#logging for more.
Type: one of <null>, “ERROR”, “NOTICE”, “INFO”, “DEBUG”
Default:
null
Example:
"INFO"
Declared by:
programs.rclone.remotes.<name>.serve.<name>.options
An attribute set of option values passed to the command.
To set a boolean option, assign it true or false. See
https://nixos.org/manual/nixpkgs/stable/#function-library-lib.cli.toCommandLineShellGNU
for more details on the format.
Some caching options are set by default, namely vfs-cache-mode = "full"
and cache-dir. These can be overridden if desired.
Type: attribute set of (null or boolean or signed integer or floating point number or string)
Default:
{ }
Declared by:
programs.rclone.remotes.<name>.serve.<name>.protocol
The protocol to use when serving this path. See https://rclone.org/commands/rclone_serve for more.
Type: one of “dlna”, “docker”, “ftp”, “http”, “nfs”, “restic”, “s3”, “sftp”, “webdav”
Example:
"http"
Declared by:
programs.rclone.requiresUnit
The name of a systemd user service that must complete before the rclone configuration file is written.
This is typically used when secrets are managed by an external provisioner whose service must run before the secrets are accessible.
When using sops-nix or agenix, this value is set automatically to sops-nix.service or agenix.service, respectively. Set this manually if you use a different secret provisioner.
Read-only on non-systemd platforms (always null), since this option has no equivalent ordering primitive outside systemd. On macOS, the config-install launchd agent retries on failure (KeepAlive.Crashed), so it will succeed on a subsequent attempt once the secret-provisioner agent has materialized the secret files.
Type: null or string
Default:
null
Example:
"agenix.service"
Declared by: