PortValhalla/lib/modules/programs/rclone.nix

48 lines
1 KiB
Nix
Raw Normal View History

2024-08-23 16:48:30 +00:00
{ lib, ... }:
2024-10-06 19:25:34 +00:00
let
inherit (lib) mkEnableOption mkOption types;
2024-08-23 16:48:30 +00:00
2024-10-06 19:25:34 +00:00
syncType = types.submodule (
{ ... }: {
options = {
dirName = mkOption {
type = types.str;
description = "The name of the directory to sync the remote files to.";
};
2024-08-23 16:48:30 +00:00
2024-10-06 19:25:34 +00:00
cacheDuration = mkOption {
type = types.nullOr types.str;
description = "The amount of time to keep files in the cache.";
2024-10-06 19:25:34 +00:00
default = null;
2024-08-23 16:48:30 +00:00
};
2024-10-06 19:25:34 +00:00
};
});
commonOptions = {
enable = mkEnableOption "rclone";
};
userOptions = commonOptions // {
configurations = mkOption {
type = types.attrsOf syncType;
description = "The configurations of the rclone mounts.";
default = { };
};
};
2024-10-06 19:25:34 +00:00
in {
options = {
valhalla.linux = {
programs.rclone = commonOptions;
users = mkOption {
type = types.attrsOf (types.submodule (
{ ... }: {
options = {
programs.rclone = userOptions;
2024-08-23 16:48:30 +00:00
};
}));
};
2024-08-23 16:48:30 +00:00
};
2024-10-06 19:25:34 +00:00
};
}