Declare options for rclone syncs
This commit is contained in:
parent
7fdac59f45
commit
ceccdea859
1 changed files with 48 additions and 1 deletions
|
@ -1,7 +1,54 @@
|
|||
{ config, lib, pkgs, ... }: {
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
nextcloud = "nextcloud";
|
||||
proton = "proton";
|
||||
syncType = lib.types.submodule (
|
||||
{ name, ... }: {
|
||||
options = {
|
||||
type = lib.mkOption {
|
||||
type = lib.types.enum [
|
||||
nextcloud
|
||||
proton
|
||||
];
|
||||
};
|
||||
|
||||
autoStart = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "Whether to start this sync automatically.";
|
||||
default = true;
|
||||
};
|
||||
|
||||
systemdDependencies = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.str;
|
||||
description = "The systemd services this sync depends on.";
|
||||
example = {
|
||||
secrets = "sops-nix.service";
|
||||
};
|
||||
};
|
||||
|
||||
environment = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.envVar;
|
||||
description = "The environment variables to pass to the service.";
|
||||
default = {};
|
||||
};
|
||||
|
||||
preLaunch = lib.mkOption {
|
||||
type = lib.types.lines;
|
||||
description = "A set of statements to run before launching the sync.";
|
||||
default = [];
|
||||
};
|
||||
};
|
||||
});
|
||||
in {
|
||||
options = {
|
||||
programs.rclone = {
|
||||
enable = lib.mkEnableOption "rclone";
|
||||
|
||||
configs = lib.mkOption {
|
||||
type = lib.types.attrsOf syncType;
|
||||
description = "The synchronizations to set up.";
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue