Refactor sync type implementation
This commit is contained in:
parent
ceccdea859
commit
5b9d42cdc0
1 changed files with 10 additions and 9 deletions
|
@ -1,15 +1,16 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
nextcloud = "nextcloud";
|
syncProviders = {
|
||||||
proton = "proton";
|
nextcloud = {};
|
||||||
|
proton = {};
|
||||||
|
};
|
||||||
|
|
||||||
syncType = lib.types.submodule (
|
syncType = lib.types.submodule (
|
||||||
{ name, ... }: {
|
{ config, name, ... }: {
|
||||||
options = {
|
options = {
|
||||||
type = lib.mkOption {
|
type = lib.mkOption {
|
||||||
type = lib.types.enum [
|
description = "The type of the sync";
|
||||||
nextcloud
|
type = lib.types.enum (builtins.attrNames syncProviders);
|
||||||
proton
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
autoStart = lib.mkOption {
|
autoStart = lib.mkOption {
|
||||||
|
@ -32,9 +33,9 @@ let
|
||||||
default = {};
|
default = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
preLaunch = lib.mkOption {
|
secretsScript = lib.mkOption {
|
||||||
type = lib.types.lines;
|
type = lib.types.lines;
|
||||||
description = "A set of statements to run before launching the sync.";
|
description = "A script for loading secrets before launching the sync.";
|
||||||
default = [];
|
default = [];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue